/* --- Google/Material Design 风格 --- */

:root {
    --google-blue: #4285F4;
    --google-blue-hover: #357ae8;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #3c4043;
    --secondary-text-color: #5f6368;
    --border-color: #dadce0;
    --md-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --md-shadow-hover: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Google Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- 布局 --- */
body > header {
    background-color: var(--card-background);
    padding: 1rem 2rem;
    box-shadow: var(--md-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

body > header h1 {
    font-size: 1.5rem;
    margin: 0;
}

body > header nav a {
    margin: 0 1rem;
    color: var(--secondary-text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
body > header nav a:hover {
    color: var(--google-blue);
}

main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    color: var(--secondary-text-color);
    font-size: 0.9em;
}

/* --- 生成器 --- */
.prompt-builder {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.result-container {
    width: 100%;
    max-width: 960px;
    margin: 1rem auto 0;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    align-items: start;
}

/* --- 组件 --- */
textarea#prompt-output {
    width: 100%;
    height: 180px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    resize: vertical;
    background-color: var(--card-background);
    box-shadow: var(--md-shadow);
}
textarea#prompt-output:focus {
    outline: 2px solid var(--google-blue);
    background-color: #f1f3f4;
}

.buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

button {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
    text-transform: uppercase;
}

button:active {
    transform: scale(0.97);
}

#copy-btn {
    background-color: var(--google-blue);
    color: white;
    border: none;
    box-shadow: var(--md-shadow);
}

#copy-btn:hover {
    background-color: var(--google-blue-hover);
    box-shadow: var(--md-shadow-hover);
}

#clear-btn {
    background-color: var(--card-background);
    color: var(--secondary-text-color);
    border: 1px solid var(--border-color);
}

#clear-btn:hover {
    background-color: #f1f3f4;
}

/* --- 移除旧样式，新增 Accordion 样式 --- */
.category-accordion {
    position: relative;
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--md-shadow);
    transition: box-shadow 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.category-accordion:hover {
    box-shadow: var(--md-shadow-hover);
    z-index: 10;
}

.accordion-header {
    width: 100%;
    background-color: transparent;
    border: none;
    padding: 1.5rem;
    font-size: 1.2em;
    font-weight: 500;
    font-family: "Google Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}
.accordion-header.active, .accordion-header:hover {
    background-color: #f8f9fa;
}

.accordion-icon {
    font-size: 1.5em;
    font-weight: 300;
    color: var(--secondary-text-color);
}

.accordion-panel {
    padding: 0 1.5rem;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-panel .options-container {
    padding-bottom: 1.5rem;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.2rem;
}

.option label {
    cursor: pointer;
    user-select: none;
    color: var(--secondary-text-color);
    transition: color 0.2s;
}

.option input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.option input[type="checkbox"]:checked + label {
    color: var(--google-blue);
    font-weight: 500;
}

/* --- 【重构】子选项样式 --- */
.option-wrapper {
    display: flex;
    flex-direction: column;
}

.parent-option {
    cursor: pointer;
}

.sub-options-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 20px;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* 不再需要这个规则，JS会处理高度 */
/*
.option-wrapper.is-open .sub-options-container {
    max-height: 500px; 
}
*/

.sub-option-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: var(--secondary-text-color);
    transition: transform 0.2s;
}

.option-wrapper.is-open .sub-option-indicator {
    transform: rotate(45deg);
}

/* --- 【重构】全局 Tooltip 样式 --- */
.tooltip-container {
    position: relative;
    display: inline-flex;
    margin-left: 4px;
}

.help-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--secondary-text-color);
    color: var(--secondary-text-color);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.shared-tooltip {
    position: fixed; /* 使用 fixed 定位，脱离所有容器限制 */
    visibility: hidden;
    opacity: 0;
    width: 260px;
    background-color: #5f6368;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    z-index: 9999; /* 确保在最顶层 */
    transition: opacity 0.2s;
    box-shadow: var(--md-shadow-hover);
    font-size: 0.85em;
    font-weight: 400;
    line-height: 1.4;
    pointer-events: none; /* 确保 tooltip 不会影响鼠标事件 */
}

.shared-tooltip.visible {
    visibility: visible;
    opacity: 1;
}

/* --- 新增：站点整体布局 --- */
.site-wrapper {
    display: flex;
    justify-content: center;
    max-width: 1800px;
    margin: 0 auto;
    gap: 1.5rem;
    padding: 0 1rem;
}

.ad-sidebar {
    width: 160px;
    flex-shrink: 0;
    padding-top: 2rem;
}

.ad-placeholder {
    width: 100%;
    height: 600px;
    background-color: #e9ecef;
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: var(--secondary-text-color);
    position: sticky;
    top: 100px;
    border-radius: 8px;
}

/* --- 响应式设计 --- */
@media (max-width: 1500px) {
    .ad-sidebar {
        display: none;
    }
    .site-wrapper {
        padding: 0;
    }
}

@media (max-width: 900px) {
    .prompt-builder {
        flex-direction: column;
    }
    .result-container {
        position: static;
        top: auto;
    }
    body > header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-icon {
    height: 40px;
    width: 40px;
} 