/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.8;
    font-size: 15px;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.required { color: var(--danger); }

/* ========== 导航栏 ========== */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

/* ========== 主内容区 ========== */
.main-content {
    padding: 24px 16px;
    min-height: calc(100vh - 120px);
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.action-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

/* ========== 卡片 ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.link-btn:hover {
    text-decoration: underline;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text);
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    line-height: 1.6;
}

.form-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ========== 平台选择网格 ========== */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.platform-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    position: relative;
}

.platform-item input[type="checkbox"] {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.platform-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.platform-item input:checked + .platform-name,
.platform-item:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.platform-name {
    font-weight: 600;
    font-size: 14px;
    padding-right: 24px;
}

.platform-style {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========== 进度条 ========== */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.platform-progress {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.platform-progress-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    background: #f1f5f9;
}

.platform-progress-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.platform-progress-item.done {
    background: #d1fae5;
    color: #065f46;
}

.platform-progress-item.done .dot {
    background: var(--success);
}

.platform-progress-item .status-text {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}

/* ========== 文章展示 ========== */
.article-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.article-tab {
    padding: 10px 16px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
}

.article-tab:hover {
    background: var(--primary-light);
}

.article-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.article-content-wrap {
    border-radius: 0 8px 8px 8px;
}

.article-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.article-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.article-meta .btn {
    margin-left: auto;
}

.quality-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.grade-excellent { background: #d1fae5; color: #065f46; }
.grade-good { background: #dbeafe; color: #1e40af; }
.grade-ok { background: #fef3c7; color: #92400e; }
.grade-bad { background: #fee2e2; color: #991b1b; }

.article-body {
    min-height: 300px;
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", sans-serif;
    font-size: 16px;
    line-height: 1.9;
}

/* ========== Markdown样式 ========== */
.markdown-body h1 {
    font-size: 24px;
    margin: 24px 0 12px;
    font-weight: 700;
}
.markdown-body h2 {
    font-size: 20px;
    margin: 20px 0 10px;
    font-weight: 600;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.markdown-body h3 {
    font-size: 17px;
    margin: 16px 0 8px;
    font-weight: 600;
}
.markdown-body p {
    margin: 10px 0;
    line-height: 1.8;
}
.markdown-body ul, .markdown-body ol {
    margin: 10px 0;
    padding-left: 24px;
}
.markdown-body li {
    margin: 6px 0;
    line-height: 1.7;
}
.markdown-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 10px 16px;
    margin: 12px 0;
    background: var(--primary-light);
    border-radius: 0 6px 6px 0;
    color: var(--text);
}
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}
.markdown-body th, .markdown-body td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}
.markdown-body th {
    background: var(--primary-light);
    font-weight: 600;
    color: var(--primary-dark);
}
.markdown-body tr:nth-child(even) {
    background: #f8fafc;
}
.markdown-body code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: Menlo, Monaco, Consolas, monospace;
}
.markdown-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 14px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
}
.markdown-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.markdown-body strong {
    font-weight: 600;
}
.markdown-body a {
    color: var(--primary);
    text-decoration: none;
}
.markdown-body a:hover {
    text-decoration: underline;
}
.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ========== 知识库列表 ========== */
.knowledge-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.knowledge-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.knowledge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.knowledge-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

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

.knowledge-card-footer .actions {
    display: flex;
    gap: 8px;
}

/* ========== 历史列表 ========== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.history-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.history-card-main h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.history-platforms {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.platform-tag {
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 12px;
    font-size: 12px;
}

.history-card-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-completed { background: #d1fae5; color: #065f46; }
.status-running { background: #dbeafe; color: #1e40af; }
.status-failed { background: #fee2e2; color: #991b1b; }
.status-pending { background: #fef3c7; color: #92400e; }

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ========== 提示框 ========== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: #fff;
}

/* ========== 移动端适配 ========== */
@media (max-width: 640px) {
    .container { padding: 0 12px; }
    .main-content { padding: 16px 12px; }
    .page-header h1 { font-size: 20px; }
    .card { padding: 16px; }
    .platform-grid { grid-template-columns: 1fr 1fr; }
    .nav-links a { padding: 6px 10px; font-size: 13px; }
    .logo { font-size: 16px; }
    .article-meta { font-size: 12px; gap: 8px; }
    .article-header h2 { font-size: 18px; }
    .flex-between { flex-direction: column; }
    .history-card { flex-direction: column; align-items: flex-start; gap: 8px; }
    .history-card-side { align-items: flex-start; }
    .knowledge-list { grid-template-columns: 1fr; }
}

/* ========== 企业切换器 ========== */
.company-switcher {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

.company-switcher-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
    max-width: 240px;
}

.company-switcher-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.company-icon { font-size: 16px; }
.company-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}
.company-arrow { font-size: 10px; color: var(--text-muted); }

.company-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 240px;
    z-index: 200;
    display: none;
    overflow: hidden;
}

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

.company-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.company-manage {
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
}
.company-manage:hover { text-decoration: underline; }

.company-menu-item {
    display: block;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

.company-menu-item:hover { background: var(--primary-light); }
.company-menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.company-menu-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

/* ========== 企业列表页 ========== */
.company-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.company-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.company-card-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-card-main h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.company-card-meta {
    padding-top: 4px;
}

.company-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.btn-danger-outline {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-danger-outline:hover {
    background: #fee2e2;
}

.inline-form {
    display: flex;
    gap: 10px;
}
.inline-form input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}
.inline-form input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========== 模态框 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    margin: 0;
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

/* ========== 移动端适配补充 ========== */
@media (max-width: 640px) {
    .company-switcher { flex: none; order: 3; width: 100%; justify-content: flex-start; }
    .navbar .container {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 8px;
    }
    .company-switcher-btn { max-width: none; flex: 1; }
    .company-name { max-width: none; }
    .company-menu { left: 0; transform: none; min-width: 100%; }
    .inline-form { flex-direction: column; }
}
/* ========== 下拉菜单 ========== */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    min-width: 120px;
    z-index: 50;
    overflow: hidden;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a {
    display: block;
    padding: 8px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}
.dropdown-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* 今日一键生成卡片 */
.quick-generate-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
}
.quick-generate-card a {
    color: #ffe066;
    text-decoration: underline;
}
.quick-gen-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}
.quick-gen-desc {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.6;
}
.quick-gen-keyword {
    font-size: 18px;
    margin-bottom: 12px;
}
.quick-gen-keyword strong {
    font-size: 22px;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 6px;
}
.quick-gen-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
    flex-wrap: wrap;
}
.quick-gen-stats strong {
    font-size: 18px;
    color: #ffe066;
    margin-right: 3px;
}
.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
}
.card-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.card-header h3 {
    margin: 0;
    font-size: 18px;
}
.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}
.quick-generating {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* ========== v11 自动发布模块样式 ========== */

/* 账号管理 */
.account-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 20px;
}
.account-stats .stat-item {
    flex: 1;
    min-width: 140px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    text-align: center;
}
.stat-platform {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.stat-count {
    font-size: 14px;
}
.stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}
.stat-active {
    font-size: 12px;
    color: var(--success);
    margin-left: 4px;
}

.account-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.account-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.account-card-body {
    flex: 1;
    padding: 16px;
}
.account-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.account-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.account-remark {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.account-card-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.account-card-footer .btn {
    flex: 1;
}

/* 平台徽标 */
.platform-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
}
.platform-badge.platform-baijiahao { background: #fff1e6; color: #e07000; }
.platform-badge.platform-toutiao { background: #fee2e2; color: #dc2626; }
.platform-badge.platform-wechat { background: #dcfce7; color: #16a34a; }
.platform-badge.platform-sohu { background: #e0e7ff; color: #4f46e5; }
.platform-badge.platform-wangyi { background: #ffedd5; color: #ea580c; }
.platform-badge.platform-qie { background: #f3e8ff; color: #9333ea; }
.platform-badge.platform-zhihu { background: #e0f2fe; color: #0284c7; }

/* 状态徽标 */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.status-badge.status-active,
.status-badge.status-success {
    background: #dcfce7;
    color: #16a34a;
}
.status-badge.status-pending {
    background: #fef3c7;
    color: #d97706;
}
.status-badge.status-invalid,
.status-badge.status-failed {
    background: #fee2e2;
    color: #dc2626;
}
.status-badge.status-publishing {
    background: #dbeafe;
    color: #2563eb;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal.show {
    display: flex;
}
.modal-content {
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
    animation: modalSlideIn 0.2s ease;
}
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 {
    margin: 0;
    font-size: 18px;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}
.modal-close:hover {
    color: var(--text);
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 13px;
}
.form-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.platform-display {
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

/* 按钮变体 */
.btn-danger-outline {
    color: var(--danger);
    border: 1px solid #fecaca;
    background: #fff;
}
.btn-danger-outline:hover {
    background: #fef2f2;
    border-color: var(--danger);
}

/* 发布记录 */
.publish-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 20px;
}
.publish-stats .stat-item {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: var(--radius);
    background: var(--bg);
}
.publish-stats .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.publish-stats .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}
.publish-stats .stat-item.success .stat-value { color: var(--success); }
.publish-stats .stat-item.publishing .stat-value { color: var(--primary); }
.publish-stats .stat-item.pending .stat-value { color: var(--warning); }
.publish-stats .stat-item.failed .stat-value { color: var(--danger); }

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
}
.filter-btn {
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.publish-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.publish-card {
    overflow: hidden;
}
.publish-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.publish-card-body {
    padding: 16px;
}
.publish-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.publish-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}
.publish-result {
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: var(--radius);
    font-size: 13px;
}
.publish-url {
    color: var(--success);
    word-break: break-all;
}
.publish-error {
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: var(--radius);
    font-size: 13px;
}
.error-text {
    color: var(--danger);
}
.publish-card-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ========== 删除功能样式 ========== */
.btn-danger {
    background: var(--danger);
    color: #fff;
    border: 1px solid var(--danger);
}
.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}
.delete-task-btn {
    margin-top: 4px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.4;
}
.article-checkbox {
    margin-right: 6px;
    cursor: pointer;
    vertical-align: middle;
    width: 14px;
    height: 14px;
}
.article-tab.selected {
    border-color: var(--danger);
    color: var(--danger);
    background: #fef2f2;
}

/* ========== v12 案例照片模式样式 ========== */

/* 模式切换 Tab */
.mode-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px 0;
    border-bottom: 1px solid var(--border-color);
}
.mode-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    font-weight: 500;
}
.mode-tab:hover {
    color: var(--primary);
}
.mode-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.mode-panel {
    display: none;
    padding: 20px 24px 24px;
}
.mode-panel.active {
    display: block;
}

/* 照片上传区域 */
.photo-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}
.photo-upload-area:hover,
.photo-upload-area.dragover {
    border-color: var(--primary);
    background: #f0f7ff;
}
.photo-upload-area.dragover {
    border-style: solid;
}
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.upload-icon {
    font-size: 40px;
    margin-bottom: 4px;
}
.upload-text {
    font-size: 15px;
    color: var(--text-primary);
}
.upload-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}
.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 照片预览网格 */
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 0;
}
.photo-preview-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}
.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.photo-delete-btn:hover {
    background: var(--danger);
}
.photo-index {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 案例信息区域 */
.case-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.case-info-header label {
    margin-bottom: 0;
}
.case-info-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}
.case-info-badge.analyzing {
    background: #fff7ed;
    color: #c2410c;
}
.case-info-badge.success {
    background: #ecfdf5;
    color: #047857;
}
.case-info-badge.warning {
    background: #fef3c7;
    color: #b45309;
}
.case-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.case-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.case-info-label {
    font-size: 12px;
    color: var(--text-secondary);
}
.case-info-item input {
    padding: 8px 10px;
    font-size: 13px;
}

@media (max-width: 600px) {
    .case-info-grid {
        grid-template-columns: 1fr;
    }
    .mode-tabs {
        padding: 12px 16px 0;
    }
    .mode-tab {
        padding: 8px 14px;
        font-size: 13px;
    }
    .mode-panel {
        padding: 16px;
    }
}

/* ============================================================
   v12 关键词裂变模块样式
   ============================================================ */

/* 开关标签 */
.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 4px;
}

/* 开关按钮 */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #4f46e5;
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

/* 裂变设置区域 */
.expand-settings {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #c7d2fe;
}

.expand-settings.hidden {
    display: none;
}

.expand-settings input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #c7d2fe;
    outline: none;
    -webkit-appearance: none;
    margin: 8px 0 4px;
}

.expand-settings input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
}

.expand-settings input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
}

/* 裂变预览 */
.expand-preview {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e7ff;
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
}

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

.expand-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e7ff;
    background: #f8faff;
    position: sticky;
    top: 0;
    font-weight: 500;
}

.expand-preview-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.kw-type-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.kw-type-badge.type-original { background: #fef3c7; color: #92400e; }
.kw-type-badge.type-basic { background: #dbeafe; color: #1e40af; }
.kw-type-badge.type-question { background: #fce7f3; color: #9d174d; }
.kw-type-badge.type-attribute { background: #d1fae5; color: #065f46; }
.kw-type-badge.type-scenario { background: #ede9fe; color: #5b21b6; }

.expand-preview-list {
    padding: 4px 0;
}

.expand-keyword-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.expand-keyword-item:last-child {
    border-bottom: none;
}

.kw-index {
    width: 24px;
    height: 24px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.kw-text {
    flex: 1;
    font-size: 14px;
    color: #1e293b;
}

.kw-type-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    flex-shrink: 0;
}

.kw-type-tag.type-original { background: #fef3c7; color: #92400e; }
.kw-type-tag.type-basic { background: #dbeafe; color: #1e40af; }
.kw-type-tag.type-question { background: #fce7f3; color: #9d174d; }
.kw-type-tag.type-attribute { background: #d1fae5; color: #065f46; }
.kw-type-tag.type-scenario { background: #ede9fe; color: #5b21b6; }

.expand-preview .loading,
.expand-preview .error {
    padding: 20px;
    text-align: center;
    color: #64748b;
}

.expand-preview .error {
    color: #dc2626;
}

/* 裂变模式结果展示 - 双层标签 */
.expanded-keyword-selector {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: wrap;
}

.kw-tab {
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}

.kw-tab:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.kw-tab.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.expanded-platform-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}


/* ========== v37.6 侧边栏布局 ========== */
.layout-sidebar {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    min-width: 250px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 2px;
}

/* Logo */
.sidebar-logo {
    padding: 20px 16px;
    border-bottom: 1px solid #334155;
}
.sidebar-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}
.logo-icon {
    font-size: 24px;
}
.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 企业切换 */
.sidebar-company {
    padding: 12px 12px;
    border-bottom: 1px solid #334155;
    position: relative;
}
.sidebar-company-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.sidebar-company-btn:hover {
    background: #475569;
}
.sidebar-company-btn .company-name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-company-btn .company-arrow {
    font-size: 10px;
    opacity: 0.7;
}
.sidebar-company-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 8px 0;
    margin-top: 4px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.sidebar-company-menu.show {
    display: block;
}
.company-menu-header {
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
    border-bottom: 1px solid #334155;
    margin-bottom: 4px;
}
.company-manage {
    color: #60a5fa;
    text-decoration: none;
    font-size: 12px;
}
.company-menu-item {
    display: block;
    padding: 8px 14px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}
.company-menu-item:hover {
    background: #334155;
}
.company-menu-item.active {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}
.company-menu-footer {
    padding: 8px 14px;
    border-top: 1px solid #334155;
    margin-top: 4px;
}

/* 导航菜单 */
.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 16px;
}
.nav-group-title {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-lock {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.6;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
    margin-bottom: 2px;
    position: relative;
}
.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    color: #fff;
    font-weight: 500;
    border-left: 3px solid #3b82f6;
    padding-left: 9px;
}
.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}
.lock-badge {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.5;
}
.nav-item.nav-locked {
    opacity: 0.5;
    cursor: not-allowed;
}
.nav-item.nav-locked:hover {
    background: transparent;
    color: #cbd5e1;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #334155;
    background: rgba(0,0,0,0.2);
}
.user-info-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 10px;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}
.user-detail {
    flex: 1;
    overflow: hidden;
}
.user-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-level {
    font-size: 11px;
    margin-top: 2px;
}
.level-free { color: #94a3b8; }
.level-standard { color: #fbbf24; }
.level-pro { color: #a78bfa; }
.level-premium { color: #f472b6; }

.user-arrow {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}
.token-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    font-size: 12px;
}
.token-label {
    color: #64748b;
}
.token-value {
    color: #4ade80;
    font-weight: 600;
    font-size: 13px;
}

/* 主内容区 */
.main-wrapper {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.main-content-inner {
    flex: 1;
    padding: 24px 28px;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
}

/* 调整原有容器样式适配新布局 */
.layout-sidebar .container {
    max-width: 100%;
    padding: 0;
}
.layout-sidebar .main-content {
    padding: 0;
    min-height: auto;
}

/* 底部 */
.layout-sidebar .footer {
    padding: 16px 28px;
    text-align: center;
    border-top: 1px solid var(--border);
}
.layout-sidebar .footer p {
    color: var(--text-muted);
    font-size: 12px;
}

/* 移动端 */
.mobile-header {
    display: none;
}
.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.show-mobile {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .mobile-header {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        background: #fff;
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 50;
    }
    .mobile-menu-btn {
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
        padding: 4px 8px;
    }
    .mobile-title {
        font-weight: 600;
        margin-left: 12px;
        color: var(--primary);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .main-content-inner {
        padding: 16px;
    }
}

/* ========== v37.6 仪表盘 ========== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px 20px;
}
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon-primary { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.stat-icon-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.stat-icon-warning { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.stat-icon-info { background: linear-gradient(135deg, #cffafe, #a5f3fc); }

.stat-content {
    flex: 1;
    min-width: 0;
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.stat-sub {
    margin-top: 4px;
    font-size: 12px;
}
.stat-link {
    color: var(--primary);
    text-decoration: none;
}
.stat-link:hover {
    text-decoration: underline;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card .card-header {
    margin-bottom: 12px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    transition: background 0.2s;
}
.recent-item:hover {
    background: #f1f5f9;
}
.recent-info {
    flex: 1;
    min-width: 0;
}
.recent-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.recent-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.platform-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.recent-score {
    flex-shrink: 0;
    margin-left: 12px;
}
.score-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.score-优秀 { background: #d1fae5; color: #059669; }
.score-良好 { background: #dbeafe; color: #2563eb; }
.score-一般 { background: #fef3c7; color: #d97706; }
.score-较差 { background: #fee2e2; color: #dc2626; }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}
.quick-action-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
}
.quick-icon {
    font-size: 24px;
}
.quick-text {
    font-size: 12px;
    font-weight: 500;
}

.consumption-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    text-align: center;
}
.overview-item {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}
.overview-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.overview-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.card-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
}
.card-link:hover {
    text-decoration: underline;
}
.card-subtitle {
    color: var(--text-muted);
    font-size: 13px;
}
.empty-state-sm {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* ========== v37.6 会员中心 ========== */
.member-status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 32px;
    background: linear-gradient(135deg, #1e40af, #7c3aed);
    color: #fff;
    border-radius: 12px;
    margin-bottom: 24px;
}
.member-status-card.level-free {
    background: linear-gradient(135deg, #475569, #334155);
}
.member-status-card.level-standard {
    background: linear-gradient(135deg, #d97706, #ea580c);
}
.member-status-card.level-pro {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
}
.member-status-card.level-premium {
    background: linear-gradient(135deg, #db2777, #7c3aed);
}
.member-status-left {
    display: flex;
    align-items: center;
    gap: 20px;
}
.member-badge {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}
.member-level-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}
.member-expire {
    font-size: 14px;
    opacity: 0.85;
}
.member-status-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.token-display {
    text-align: right;
}
.token-display .token-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 4px;
}
.token-amount {
    font-size: 24px;
    font-weight: 700;
}

/* 会员套餐 */
.member-plans {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
}
@media (max-width: 1100px) {
    .member-plans {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 560px) {
    .member-plans {
        grid-template-columns: 1fr;
    }
}
.plan-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    background: #fff;
}
.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}
.plan-card.plan-current {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.plan-header {
    padding: 24px 20px;
    text-align: center;
    position: relative;
}
.plan-free { background: #f8fafc; }
.plan-standard { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.plan-pro { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
.plan-premium { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }

.plan-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0,0,0,0.1);
}
.plan-hot {
    background: #ef4444;
    color: #fff;
}
.plan-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}
.plan-price .currency {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.plan-price .price-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
}
.plan-price .price-period {
    font-size: 13px;
    color: var(--text-muted);
}
.plan-original {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-top: 4px;
}
.plan-features {
    padding: 20px;
    flex: 1;
}
.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text);
}
.feature-item .check {
    color: #10b981;
    font-weight: 700;
}
.feature-item .cross {
    color: #cbd5e1;
}
.feature-item.feature-disabled {
    color: #94a3b8;
}
.plan-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}
.btn-disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* 权益列表 */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.benefit-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}
.benefit-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.benefit-name {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.benefit-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* ========== v37.6 充值中心 ========== */
.recharge-balance-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    border-radius: 12px;
    margin-bottom: 24px;
}
.balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 6px;
}
.balance-amount {
    font-size: 36px;
    font-weight: 700;
}
.balance-sub {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 4px;
}
.balance-tip {
    max-width: 400px;
    text-align: right;
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.8;
}

.recharge-packages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 20px 0;
}
@media (max-width: 1100px) {
    .recharge-packages {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 500px) {
    .recharge-packages {
        grid-template-columns: 1fr;
    }
}
.package-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
    background: #fff;
}
.package-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}
.package-card.package-recommended {
    border-color: var(--primary);
    background: linear-gradient(180deg, #eff6ff, #fff);
}
.package-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
}
.package-price {
    margin-bottom: 12px;
}
.package-price .currency {
    font-size: 16px;
    color: var(--text);
    vertical-align: top;
}
.package-price .amount {
    font-size: 40px;
    font-weight: 700;
    color: var(--text);
}
.package-token {
    margin-bottom: 10px;
}
.package-token .token-num {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
}
.package-token .token-unit {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 4px;
}
.package-bonus {
    color: #f59e0b;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}
.package-total {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border);
}
.package-btn {
    padding: 12px;
    font-size: 15px;
}

.recharge-notice {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-top: 16px;
}
.notice-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.notice-content {
    flex: 1;
    line-height: 1.9;
    font-size: 14px;
    color: var(--text);
}

/* ========== v37.6 消费记录 ========== */
.consumption-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 900px) {
    .consumption-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.type-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.type-stat-item {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}
.type-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-name {
    font-weight: 500;
    font-size: 14px;
}
.type-amount {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
}
.type-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.type-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.type-article_gen { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.type-geo_diagnosis { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.type-publish { background: linear-gradient(90deg, #10b981, #34d399); }
.type-video_mix { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.type-digital_human { background: linear-gradient(90deg, #ec4899, #f472b6); }

.type-stat-footer {
    display: flex;
    justify-content: space-between;
}

.filter-tabs {
    display: flex;
    gap: 4px;
}
.filter-tab {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}
.filter-tab:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.filter-tab.active {
    background: var(--primary);
    color: #fff;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text);
}
.data-table tbody tr:hover {
    background: #f8fafc;
}
.token-amount-cell {
    font-weight: 600;
    color: #ef4444;
}

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.type-badge.type-article_gen { background: #dbeafe; color: #2563eb; }
.type-badge.type-geo_diagnosis { background: #ede9fe; color: #7c3aed; }
.type-badge.type-publish { background: #d1fae5; color: #059669; }
.type-badge.type-video_mix { background: #fef3c7; color: #d97706; }
.type-badge.type-digital_human { background: #fce7f3; color: #db2777; }

.status-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.status-tag.status-success { background: #d1fae5; color: #059669; }
.status-tag.status-pending { background: #fef3c7; color: #d97706; }
.status-tag.status-failed { background: #fee2e2; color: #dc2626; }

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 0;
    margin-top: 16px;
    border-top: 1px solid var(--border);
}
.page-info {
    font-size: 13px;
    color: var(--text-muted);
}
.page-buttons {
    display: flex;
    gap: 8px;
}

/* 页面header响应式调整 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.card-header h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}
/* ========== GEO诊断模式选择 ========== */
.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}
.mode-option {
    cursor: pointer;
    margin: 0;
}
.mode-option input[type="radio"] {
    display: none;
}
.mode-card {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.2s;
    background: #fff;
    position: relative;
}
.mode-option input[type="radio"]:checked + .mode-card {
    border-color: var(--primary);
    background: #eff6ff;
}
.mode-option:hover .mode-card {
    border-color: var(--primary);
}
.mode-option.mode-locked .mode-card {
    opacity: 0.6;
    cursor: not-allowed;
}
.mode-option.mode-locked:hover .mode-card {
    border-color: var(--border);
}
.mode-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.mode-lock {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 6px;
    font-weight: normal;
}
.mode-recommend {
    font-size: 11px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 500;
}
.mode-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.mode-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}
.link-primary {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.link-primary:hover {
    text-decoration: underline;
}

/* v37.6.1 登录 & 注册 */
.sidebar-logout {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}
.logout-link {
    color: #94a3b8;
    font-size: 12px;
    text-decoration: none;
}
.logout-link:hover {
    color: #fff;
}



/* 文章内容首行缩进 */

#article-body p {

    text-indent: 2em;

}




/* 文章段落间距 */

#article-body p {

    margin-bottom: 1em;

    line-height: 1.8;

}


/* ========== 生意档案页面 ========== */
.form-row {
    display: flex;
    gap: 16px;
}
.form-row .form-group {
    flex: 1;
}
.field-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.5;
}
.field-hint-warn {
    color: var(--warning-color, #f59e0b);
}
.card-header .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}
@media (max-width: 640px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
