/* AI Generator Section */
.ai-generator {
    background: linear-gradient(180deg, #f5f3ff 0%, #fdf2f8 50%, #faf5ff 100%);
    padding: 2rem 0 4rem;
}

/* Generator Header */
.generator-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.header-left {
    flex: 1;
}

.generator-title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.generator-subtitle {
    font-size: 1rem;
    color: #64748b;
}

.header-right {
    text-align: right;
}

.remain-count {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 20px;
    font-size: 0.875rem;
    color: #92400e;
}

.remain-count strong {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Generator Input */
.generator-input {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

/* Platform Tabs */
.platform-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 12px;
    width: fit-content;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* Field Row */
.field-row {
    margin-bottom: 1.5rem;
}

.field-group {
    display: inline-block;
}

.field-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.field-select {
    padding: 0.5rem 2rem 0.5rem 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    color: var(--text-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    appearance: none;
    cursor: pointer;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.field-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ==================== 自定义下拉框 ==================== */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
    cursor: pointer;
    min-width: 120px;
}

.dropdown-trigger:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.dropdown-arrow {
    font-size: 0.625rem;
    color: #64748b;
    margin-left: auto;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.375rem;
    padding: 0.375rem;
    background: white;
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
    list-style: none;
    z-index: 100;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu li {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-menu li:hover {
    background: #f5f3ff;
    color: var(--primary-color);
}

.dropdown-menu li.active {
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    color: var(--primary-color);
    font-weight: 500;
}

/* Content Input */
.content-input {
    margin-bottom: 1.5rem;
}

.content-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9375rem;
    line-height: 1.7;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.content-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.content-textarea::placeholder {
    color: #94a3b8;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.25rem;
}

/* Generator Output */
.generator-output {
    margin-top: 2rem;
}

.generator-output.hidden {
    display: none;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.output-header h3 {
    font-size: 1.25rem;
    color: var(--text-color);
}

.btn-secondary {
    padding: 0.625rem 1.25rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Result Cards */
.result-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.result-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.result-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}

.result-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.card-header {
    position: relative;
    margin-bottom: 1rem;
    min-height: 36px;
    width: 100%;
}

.card-badge {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.card-style {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.card-content {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.8;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.btn-card {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn-card.save {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-card.save:hover {
    background: var(--primary-color);
    color: white;
}

.btn-card.save.saved {
    background: #10b981;
    color: white;
    border-color: #10b981;
    cursor: default;
}

.btn-card.copy {
    background: #f1f5f9;
    color: var(--text-color);
}

.btn-card.copy:hover {
    background: var(--text-color);
    color: white;
}

.btn-card.copy.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

/* Loading Area */
.generator-loading {
    margin-top: 2rem;
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 16px;
}

.generator-loading.hidden {
    display: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.generator-loading p {
    color: #64748b;
    font-size: 0.9375rem;
}

/* Responsive */
@media (max-width: 900px) {
    .result-cards {
        grid-template-columns: 1fr;
    }

    .generator-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 1.5rem;
    }

    .header-right {
        text-align: left;
    }

    .library-header {
        flex-wrap: wrap;
        padding: 1rem 1.5rem;
        gap: 0.75rem;
    }
}

@media (max-width: 600px) {
    .result-cards {
        gap: 1rem;
    }

    .result-card {
        padding: 1.25rem;
    }
}

/* Toast 弹窗 */
.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    z-index: 1003;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: block;
}

.toast.hidden {
    display: none !important;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

/* ==================== 页面级Tab切换 ==================== */
.page-tabs {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.page-tab-btns {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.page-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.page-tab-btn:hover {
    color: var(--primary-color);
    background: #f5f3ff;
}

.page-tab-btn.active {
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.page-tab-icon {
    font-size: 1.125rem;
}

.library-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    background: #ef4444;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    margin-left: 0.25rem;
}

/* 通用隐藏类 */
.hidden {
    display: none !important;
}

/* ==================== 学习爆款模块 ==================== */
.learn-viral {
    background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 50%, #fdf2f8 100%);
    padding: 2rem 0 4rem;
}

.learn-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.learn-icon {
    font-size: 2.5rem;
}

.learn-title-area {
    flex: 1;
}

.learn-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.learn-subtitle {
    font-size: 0.9375rem;
    color: #64748b;
}

.learn-input {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.learn-textarea-wrap {
    margin-bottom: 1.5rem;
}

.learn-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9375rem;
    line-height: 1.8;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.learn-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.learn-textarea::placeholder {
    color: #94a3b8;
}

.btn-analyze {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
}

.btn-analyze:active {
    transform: translateY(0);
}

.btn-analyze:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.learn-output {
    margin-top: 2rem;
}

.learn-output.hidden {
    display: none;
}

.learn-result-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

/* 分析卡片样式 */
.analysis-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
}

.analysis-card.header-title { border-top: 3px solid #6366f1; }
.analysis-card.header-opening { border-top: 3px solid #f472b6; }
.analysis-card.header-structure { border-top: 3px solid #10b981; }
.analysis-card.header-tags { border-top: 3px solid #f59e0b; }
.analysis-card.header-optimize { border-top: 3px solid #ef4444; }

.analysis-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.analysis-card-icon {
    font-size: 1.25rem;
}

.analysis-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
}

.analysis-card-summary {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 8px;
    border-left: 3px solid currentColor;
    word-break: break-word;
    overflow-wrap: break-word;
}

.analysis-card-points {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analysis-card-points li {
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.6;
    padding: 0.375rem 0;
    padding-left: 1rem;
    position: relative;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.analysis-card-points li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #94a3b8;
}

.analysis-card-content {
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.7;
    flex: 1;
    word-break: break-word;
}

.learn-action {
    margin-top: 1.5rem;
    text-align: center;
}

.btn-generate-similar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-generate-similar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

/* 响应式 */
@media (max-width: 900px) {
    .learn-result-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .learn-header {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .learn-result-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .learn-header {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .learn-icon {
        font-size: 1.5rem;
    }

    .learn-title {
        font-size: 1rem;
    }

    .learn-subtitle {
        font-size: 0.75rem;
    }

    .learn-input {
        padding: 1rem;
    }

    .generator-header {
        padding: 1rem;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .generator-title {
        font-size: 1.25rem;
    }

    .generator-subtitle {
        font-size: 0.8125rem;
    }

    .library-header {
        padding: 0.5rem 0.75rem;
        gap: 0.375rem;
        margin-bottom: 0.75rem;
    }

    .library-icon {
        font-size: 1.25rem;
    }

    .library-title {
        font-size: 0.875rem;
    }

    .library-subtitle {
        font-size: 0.6875rem;
    }
}

/* ==================== 素材库模块 ==================== */
.library-section {
    background: linear-gradient(180deg, #f0fdf4 0%, #fdf2f8 50%, #faf5ff 100%);
    padding: 2rem 0 4rem;
}

.library-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.library-icon {
    font-size: 2.5rem;
}

.library-title-area {
    flex: 1;
}

.library-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.library-subtitle {
    font-size: 0.9375rem;
    color: #64748b;
}

.library-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-clear-library {
    padding: 0.5rem 1rem;
    background: white;
    color: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-library:hover {
    background: #ef4444;
    color: white;
}

.library-list {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.library-list.show {
    display: grid;
}

.library-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    text-align: center;
}

.library-empty.show {
    display: flex;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.library-empty p {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.library-empty span {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* 素材卡片 */
.material-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.material-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
}

.material-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.material-platform {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
}

.material-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.material-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.material-content {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.material-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.material-tag {
    padding: 0.125rem 0.5rem;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 0.6875rem;
    color: #64748b;
}

.material-actions {
    display: flex;
    gap: 0.5rem;
}

.material-actions button {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.btn-use {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-use:hover {
    background: var(--primary-color);
    color: white;
}

.btn-delete {
    background: white;
    color: #ef4444;
    border-color: #ef4444;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
}

/* 响应式 */
@media (max-width: 900px) {
    .library-list {
        grid-template-columns: 1fr;
    }

    .library-header {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .library-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .library-header {
        flex-direction: column;
        text-align: center;
        padding: 0.5rem 0.75rem;
        gap: 0.375rem;
        margin-bottom: 0.75rem;
    }

    .library-icon {
        font-size: 1.25rem;
    }

    .library-title {
        font-size: 0.875rem;
    }

    .library-subtitle {
        font-size: 0.6875rem;
    }

    .library-actions {
        margin-top: 0.5rem;
    }

    /* 移动端页面Tab修复 */
    .page-tab-btns {
        max-width: 100%;
        gap: 0.25rem;
    }

    .page-tab-btn {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
        gap: 0.25rem;
    }

    .page-tab-icon {
        font-size: 1rem;
    }

    .library-badge {
        min-width: 16px;
        height: 16px;
        padding: 0 0.25rem;
        font-size: 0.625rem;
        margin-left: 0.125rem;
    }

    /* 移动端素材卡片底部按钮 */
    .material-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .material-platform-tag {
        justify-content: center;
    }

    .material-actions {
        width: 100%;
        justify-content: center;
    }

    .material-actions button {
        flex: 1;
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ==================== 素材卡片（新样式） ==================== */
.material-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.material-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.12);
}

.material-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.material-source {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #16a34a;
}

.material-source::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #16a34a;
    border-radius: 50%;
}

.material-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.material-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.material-summary {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 1rem;
    padding: 0.875rem;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 3px solid var(--primary-color);
}

.material-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.material-tag {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.material-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.material-platform-tag {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.material-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.material-actions button {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    background: white;
    white-space: nowrap;
}

.btn-reference {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-reference:hover {
    background: var(--primary-color);
    color: white;
}

.btn-convert {
    color: #f59e0b;
    border-color: #f59e0b;
}

.btn-convert:hover {
    background: #f59e0b;
    color: white;
}

.btn-delete-card {
    color: #ef4444;
    border-color: #ef4444;
}

.btn-delete-card:hover {
    background: #ef4444;
    color: white;
}

/* ==================== 转换平台弹窗 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1004;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 360px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-tip {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.25rem;
    text-align: center;
}

.platform-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.platform-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.platform-option:hover {
    border-color: var(--primary-color);
    background: #f5f3ff;
}

.platform-option:has(input:checked) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
}

.platform-option input {
    display: none;
}

.platform-option .platform-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-color);
}

.platform-option:has(input:checked) .platform-label {
    color: var(--primary-color);
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal-footer button {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-cancel {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-modal-cancel:hover {
    background: #e2e8f0;
}

.btn-modal-confirm {
    background: var(--gradient);
    border: none;
    color: white;
}

.btn-modal-confirm:hover {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-modal-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==================== 素材内容预览弹窗 ==================== */
#cardPreviewModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#cardPreviewModal.hidden {
    display: none;
}

#cardPreviewModal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: auto;
}

#cardPreviewModal .preview-wrapper {
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: var(--text-color);
}

.btn-cancel-preview {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-cancel-preview:hover {
    background: #e2e8f0;
}

/* ==================== 设置弹窗 ==================== */
.nav-settings-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.nav-settings-btn:hover {
    background: #f5f3ff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.settings-wrapper {
    position: relative;
    width: 90%;
    max-width: 480px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.settings-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.settings-close:hover {
    background: #e2e8f0;
    color: var(--text-color);
}

.settings-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-field {
    margin-bottom: 1rem;
}

.settings-field:last-child {
    margin-bottom: 0;
}

.settings-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.settings-field input,
.settings-field textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.settings-field input:focus,
.settings-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.settings-field textarea {
    resize: vertical;
    line-height: 1.6;
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.375rem;
}

.settings-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.settings-footer button {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-settings-cancel {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-settings-cancel:hover {
    background: #e2e8f0;
}

.btn-settings-save {
    background: var(--gradient);
    border: none;
    color: white;
}

.btn-settings-save:hover {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* ==================== 转换结果预览 ==================== */
.convert-preview {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.convert-preview.hidden {
    display: none;
}

.preview-wrapper {
    width: 100%;
    max-width: 560px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.preview-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.preview-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.preview-close:hover {
    background: #e2e8f0;
    color: var(--text-color);
}

.preview-card {
    padding: 1.5rem;
    max-height: 50vh;
    overflow-y: auto;
}

.preview-platform {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.preview-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.preview-content {
    font-size: 0.9375rem;
    color: #475569;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 1rem;
}

.preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preview-tags .tag {
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.preview-actions button {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-as-new {
    background: var(--gradient);
    border: none;
    color: white;
}

.btn-save-as-new:hover {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-regenerate {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-regenerate:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 转换中Loading */
.convert-loading {
    text-align: center;
    padding: 3rem;
}

.convert-loading .loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
