/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6c5ce7;
    --primary-dark: #5849c2;
    --primary-light: #a29bfe;
    --primary-bg: #f0edff;
    --secondary: #fd79a8;
    --accent: #00cec9;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e74c3c;
    --dark: #2d3436;
    --gray: #636e72;
    --gray-light: #b2bec3;
    --gray-bg: #f5f6fa;
    --white: #ffffff;
    --border: #dfe6e9;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--gray-bg);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

input, textarea, select {
    font-family: inherit;
    outline: none;
    border: none;
}

/* ===== 认证页面 ===== */
.auth-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(255,255,255,0.12) 0%, transparent 50%);
}

.auth-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: cardSlideIn 0.6s ease;
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    font-size: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.auth-logo p {
    color: var(--gray);
    font-size: 14px;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 6px;
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
    transition: var(--transition);
}

.auth-form input:focus,
.auth-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.phone-verify-row {
    display: flex;
    gap: 8px;
}

.phone-verify-row input {
    flex: 1;
}

.btn-verify {
    padding: 12px 16px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

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

.btn-verify:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 按钮 ===== */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-top: 6px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
}

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

.auth-switch {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 13px;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-guest {
    text-align: center;
    margin-top: 16px;
}

.btn-text {
    background: none;
    color: var(--gray);
    font-size: 13px;
}

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

.btn-secondary {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), #0984e3);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 206, 201, 0.4);
}

.btn-outline {
    padding: 12px 24px;
    background: var(--white);
    color: var(--gray);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

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

.btn-icon {
    background: none;
    font-size: 24px;
    padding: 4px 8px;
    color: var(--gray);
}

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

.btn-recommend {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--success), #00cec9);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-recommend:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 184, 148, 0.4);
}

.btn-recommend.is-active {
    background: linear-gradient(135deg, var(--warning), #e17055);
    color: var(--dark);
}

/* ===== 主界面导航栏 ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    height: 64px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-logo {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
}

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

.nav-tab {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.nav-tab:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.nav-tab.active {
    background: var(--primary);
    color: var(--white);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-search {
    position: relative;
}

.nav-search input {
    padding: 9px 36px 9px 16px;
    border: 2px solid var(--border);
    border-radius: 24px;
    font-size: 13px;
    width: 240px;
    transition: var(--transition);
}

.nav-search input:focus {
    border-color: var(--primary);
    width: 280px;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

.nav-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 24px;
    transition: var(--transition);
}

.nav-user:hover {
    background: var(--gray-bg);
}

#nav-username {
    font-size: 14px;
    font-weight: 500;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 260px;
    padding: 8px;
    display: none;
    animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.dropdown-name {
    font-size: 15px;
    font-weight: 600;
}

.dropdown-role {
    font-size: 12px;
    color: var(--gray-light);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.dropdown-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.dropdown-item small {
    margin-left: auto;
    font-size: 11px;
    color: var(--gray-light);
}

/* ===== 页面内容 ===== */
.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px;
    animation: pageIn 0.4s ease;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 推荐位 ===== */
.featured-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    color: var(--white);
    display: flex;
    gap: 28px;
    align-items: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.featured-card::before {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.featured-cover {
    width: 120px;
    height: 160px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.featured-info {
    flex: 1;
    z-index: 1;
}

.featured-badge {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 8px;
}

.featured-info h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.featured-info .featured-author {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 12px;
}

.featured-info .featured-desc {
    font-size: 14px;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.featured-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.featured-tag {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.featured-empty {
    text-align: center;
    padding: 48px;
    color: var(--gray-light);
}

/* ===== 筛选区 ===== */
.filter-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    min-width: 50px;
}

.filter-btn {
    padding: 6px 14px;
    background: var(--gray-bg);
    color: var(--gray);
    border-radius: 16px;
    font-size: 13px;
    transition: var(--transition);
}

.filter-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
}

/* ===== 剧本卡片网格 ===== */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.script-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.script-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.script-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-bg);
}

.script-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.script-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.script-card-author {
    font-size: 12px;
    color: var(--gray-light);
    margin-bottom: 8px;
}

.script-card-desc {
    font-size: 13px;
    color: var(--gray);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin-bottom: 12px;
}

.script-card-footer {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.script-tag {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
}

.tag-channel-male {
    background: #dfe6ff;
    color: #2d3eb0;
}

.tag-channel-female {
    background: #ffe0f0;
    color: #c44583;
}

.tag-genre {
    background: var(--primary-bg);
    color: var(--primary);
}

.tag-progress-updating {
    background: #d4f5e9;
    color: #009961;
}

.tag-progress-completed {
    background: #e3e3e3;
    color: #555;
}

.tag-progress-new {
    background: #fff3d4;
    color: #c4860a;
}

.script-wordcount {
    font-size: 11px;
    color: var(--gray-light);
    margin-left: auto;
}

.empty-state {
    text-align: center;
    padding: 60px;
    color: var(--gray-light);
    font-size: 16px;
}

/* ===== 剧本详情页 ===== */
.detail-header {
    position: relative;
    height: 280px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
}

.detail-header-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(2px);
    transform: scale(1.1);
}

.detail-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
}

.detail-header-content {
    position: relative;
    z-index: 1;
    padding: 28px;
    display: flex;
    gap: 24px;
    align-items: flex-end;
    width: 100%;
}

.detail-cover {
    width: 120px;
    height: 160px;
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.detail-title-area {
    color: var(--white);
    flex: 1;
}

.detail-title-area h2 {
    font-size: 28px;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.detail-title-area .detail-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    opacity: 0.9;
    flex-wrap: wrap;
}

.detail-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.detail-info-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.detail-info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail-info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--gray);
    width: 80px;
    font-size: 14px;
}

.info-value {
    color: var(--dark);
    font-size: 14px;
}

.detail-actions {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-actions button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chapter-section {
    grid-column: 1 / -1;
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chapter-header h3 {
    font-size: 18px;
}

.chapter-header small {
    font-size: 13px;
    color: var(--gray-light);
    font-weight: normal;
    margin-left: 8px;
}

.chapter-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.chapter-list.expanded {
    max-height: none;
}

.chapter-item {
    padding: 12px 16px;
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.chapter-item .chapter-num {
    font-weight: 600;
    margin-right: 8px;
}

.chapter-item .chapter-wordcount {
    font-size: 11px;
    color: var(--gray-light);
}

/* ===== 阅读页 ===== */
.read-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.read-header-bar h3 {
    font-size: 18px;
    text-align: center;
    flex: 1;
}

.read-header-right {
    width: 40px;
}

.read-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 48px;
    box-shadow: var(--shadow);
    min-height: 400px;
    font-size: 16px;
    line-height: 2;
}

.read-content .chapter-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.read-content .chapter-text {
    white-space: pre-wrap;
    color: #333;
}

.read-nav {
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
}

/* ===== 评论区 ===== */
.comments-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-top: 24px;
}

.comments-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.comment-input-area {
    margin-bottom: 24px;
}

.comment-input-area textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    resize: vertical;
    margin-bottom: 8px;
    transition: var(--transition);
}

.comment-input-area textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.comment-input-area .btn-primary {
    width: auto;
    padding: 10px 24px;
    letter-spacing: 0;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.comment-time {
    font-size: 12px;
    color: var(--gray-light);
}

.comment-text {
    font-size: 14px;
    color: var(--gray);
}

.comments-empty {
    text-align: center;
    padding: 32px;
    color: var(--gray-light);
    font-size: 14px;
}

/* ===== 我的作品列表 ===== */
.my-scripts-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.my-scripts-section > h4 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-bg);
}

.my-scripts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.my-scripts-empty {
    text-align: center;
    padding: 20px;
    color: var(--gray-light);
    font-size: 13px;
}

.my-script-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.my-script-item:hover {
    background: var(--primary-bg);
}

.my-script-item img {
    width: 44px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.my-script-item .item-info {
    flex: 1;
    min-width: 0;
}

.my-script-item .item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-script-item .item-meta {
    font-size: 12px;
    color: var(--gray-light);
    margin-top: 2px;
}

.my-script-item .item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

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

.btn-sm-outline {
    background: var(--white);
    color: var(--gray);
    border: 1px solid var(--border);
}

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

/* 编辑模式提示 */
.edit-mode-info {
    background: linear-gradient(135deg, var(--primary-bg), #e8e3ff);
    border: 1px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

/* 章节替换按钮 */
.chapter-replace-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn-replace-chapter {
    background: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px dashed var(--primary-light);
    cursor: pointer;
    transition: var(--transition);
}

.btn-replace-chapter:hover {
    background: var(--primary-bg);
    border-style: solid;
}

/* ===== 上传页 ===== */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-container > h2 {
    font-size: 24px;
    margin-bottom: 24px;
}

.upload-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 32px;
}

.form-section > h4 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-bg);
    color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.upload-form .form-group {
    margin-bottom: 16px;
}

.upload-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 6px;
}

.required {
    color: var(--danger);
}

.upload-form input,
.upload-form select,
.upload-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
    transition: var(--transition);
}

.upload-form input:focus,
.upload-form select:focus,
.upload-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.upload-form textarea {
    resize: vertical;
}

.upload-form small {
    font-size: 11px;
    color: var(--gray-light);
}

.cover-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.cover-option {
    height: 160px;
    border-radius: var(--radius-sm);
    border: 3px solid transparent;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.cover-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-option:hover {
    transform: scale(1.05);
}

.cover-option.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.cover-option.selected::after {
    content: '\u2714';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* ===== Word 文档上传区域 ===== */
.word-upload-area {
    margin-bottom: 20px;
}

.word-upload-dropzone {
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--primary-bg);
}

.word-upload-dropzone:hover,
.word-upload-dropzone.drag-over {
    border-color: var(--primary);
    background: rgba(74, 144, 226, 0.08);
    transform: translateY(-1px);
}

.word-upload-dropzone.has-file {
    border-style: solid;
    border-color: var(--success);
    background: rgba(0, 184, 148, 0.05);
}

.dropzone-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.dropzone-content p {
    margin: 4px 0;
    color: var(--text-secondary, #666);
    font-size: 14px;
}

.dropzone-sub {
    font-size: 12px;
    opacity: 0.6;
}

.dropzone-content .btn-outline {
    margin-top: 10px;
}

/* 解析状态 */
.word-parse-status {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: none;
}

.word-parse-status.show {
    display: block;
}

.word-parse-status.parsing {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.word-parse-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.word-parse-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

.word-parse-status .parse-chapter-list {
    margin-top: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.word-parse-status .parse-chapter-item {
    padding: 3px 0;
    font-size: 12px;
    color: #155724;
}

/* 警告区域 */
.word-warnings {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.word-warnings h5 {
    font-size: 14px;
    color: #856404;
    margin-bottom: 8px;
}

.word-warnings .warning-item {
    font-size: 13px;
    color: #856404;
    padding: 3px 0;
    padding-left: 16px;
    position: relative;
}

.word-warnings .warning-item::before {
    content: '⚠️';
    position: absolute;
    left: 0;
    font-size: 12px;
}

.word-warnings .warning-item.missing {
    color: #d63031;
}

.word-warnings .warning-item.suspicious {
    color: #e17055;
}

/* 章节缺失高亮 */
.chapter-upload-item.has-gap {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.04);
}

.chapter-upload-item.has-gap::after {
    content: '⚠ 此处可能缺章';
    display: block;
    font-size: 11px;
    color: #e17055;
    margin-top: 6px;
    font-weight: 600;
}

.chapter-upload-item {
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.chapter-upload-item.existing-chapter {
    border-left: 3px solid var(--primary-light);
}

.chapter-upload-item .form-group {
    margin-bottom: 10px;
}

.chapter-upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chapter-upload-header span {
    font-weight: 600;
    font-size: 14px;
}

.chapter-upload-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chapter-original {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    margin-right: 4px;
    font-weight: 700;
}

.chapter-new-badge {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    margin-right: 4px;
    font-weight: 700;
}

.btn-remove-chapter {
    background: none;
    color: var(--danger);
    font-size: 13px;
}

.btn-remove-chapter:hover {
    text-decoration: underline;
}

.btn-add-chapter {
    width: 100%;
    padding: 12px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: 2px dashed var(--primary-light);
}

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

.upload-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 16px;
    border-top: 2px solid var(--border);
}

.upload-actions .btn-primary {
    width: auto;
    padding: 13px 32px;
    letter-spacing: 0;
}

/* ===== 管理面板 ===== */
.admin-container {
    max-width: 900px;
    margin: 0 auto;
}

.admin-container > h2 {
    font-size: 24px;
    margin-bottom: 24px;
}

.admin-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.admin-section > h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.admin-hint {
    font-size: 13px;
    color: var(--gray-light);
    margin-bottom: 16px;
}

.admin-recommend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-recommend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.admin-recommend-item:hover {
    background: var(--primary-bg);
}

.admin-recommend-item img {
    width: 40px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
}

.admin-recommend-item .item-info {
    flex: 1;
}

.admin-recommend-item .item-title {
    font-size: 14px;
    font-weight: 600;
}

.admin-recommend-item .item-meta {
    font-size: 12px;
    color: var(--gray-light);
}

.admin-recommend-item .btn-set-recommend {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    background: var(--gray-bg);
    color: var(--gray);
}

.admin-recommend-item .btn-set-recommend.is-recommended {
    background: var(--success);
    color: var(--white);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-bg), #e8e3ff);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.stat-num {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 400px;
    max-width: 90vw;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

.modal-hint {
    font-size: 13px;
    color: var(--gray-light);
    margin-bottom: 16px;
}

.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.modal .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions button {
    width: auto;
    padding: 10px 24px;
    letter-spacing: 0;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
    color: var(--dark);
}

/* ===== 书评区页面 ===== */
.reviews-container {
    max-width: 800px;
    margin: 0 auto;
}

.reviews-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.reviews-header-bar h3 {
    font-size: 18px;
    text-align: center;
    flex: 1;
}

.reviews-info {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    text-align: center;
    color: var(--gray);
    font-size: 14px;
}

.reviews-input-area {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.reviews-input-area textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    resize: vertical;
    margin-bottom: 12px;
    transition: var(--transition);
}

.reviews-input-area textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.reviews-input-area .btn-primary {
    width: auto;
    padding: 10px 28px;
    letter-spacing: 0;
    float: right;
}

.reviews-input-area::after {
    content: '';
    display: table;
    clear: both;
}

.reviews-list {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reviews-list h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.review-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

.review-body {
    flex: 1;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.review-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.review-time {
    font-size: 12px;
    color: var(--gray-light);
}

.review-text {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.7;
}

.reviews-empty {
    text-align: center;
    padding: 40px;
    color: var(--gray-light);
    font-size: 14px;
}

/* ===== 收藏按钮 ===== */
.btn-favorite {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-favorite:hover {
    border-color: #f5a623;
    color: #f5a623;
}

.btn-favorite.is-favorited {
    background: #fff8e1;
    border-color: #f5a623;
    color: #f5a623;
}

.btn-favorite.is-favorited:hover {
    background: #fff3cd;
}

/* ===== 个人收藏页面 ===== */
.favorites-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

.favorites-container > h2 {
    font-size: 24px;
    margin-bottom: 24px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.btn-unfavorite {
    width: 100%;
    margin-top: 10px;
    padding: 6px 12px;
    border: 1px solid #ff5252;
    border-radius: var(--radius-sm);
    background: transparent;
    color: #ff5252;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-unfavorite:hover {
    background: #fff0f0;
}

/* ===== 管理面板 - 用户信息 ===== */
.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-user-item {
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.admin-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.admin-user-header:hover {
    background: var(--primary-bg);
}

.admin-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-user-info {
    flex: 1;
}

.admin-user-name {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-user-role {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.admin-user-role.role-admin {
    background: #e3f2fd;
    color: #1976d2;
}

.admin-user-role.role-author {
    background: #f3e5f5;
    color: #7b1fa2;
}

.admin-user-role.role-user {
    background: #e8f5e9;
    color: #388e3c;
}

.admin-user-role.role-guest {
    background: #fafafa;
    color: #999;
}

.admin-user-meta {
    font-size: 13px;
    color: var(--gray-light);
    margin-top: 4px;
}

.admin-user-expand {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.admin-user-nofav {
    color: var(--gray-light);
}

.admin-user-fav-list {
    padding: 0 16px 16px 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-user-fav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.admin-user-fav-item:hover {
    box-shadow: var(--shadow);
}

.admin-user-fav-item img {
    width: 36px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.fav-item-info {
    flex: 1;
}

.fav-item-title {
    font-size: 14px;
    font-weight: 600;
}

.fav-item-meta {
    font-size: 12px;
    color: var(--gray-light);
    margin-top: 2px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
        flex-wrap: wrap;
        height: auto;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .nav-left {
        gap: 16px;
    }

    .nav-search input {
        width: 150px;
    }

    .nav-search input:focus {
        width: 180px;
    }

    .page-content {
        padding: 16px;
    }

    .scripts-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .script-cover {
        height: 150px;
    }

    .detail-body {
        grid-template-columns: 1fr;
    }

    .detail-header {
        height: auto;
        padding-bottom: 20px;
    }

    .detail-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .featured-card {
        flex-direction: column;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .read-content {
        padding: 24px 16px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    #nav-username {
        display: none;
    }
}
