/* 字体加载定义 */
@font-face {
    font-family: 'Source Han Serif SC VF';
    src: url('./SourceHanSerifSC-VF.ttf') format('truetype');
    font-display: swap;
    font-weight: 100 900;
    font-style: normal;
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF;
}

@font-face {
    font-family: 'Source Han Sans SC VF';
    src: url('./SourceHanSansSC-VF.otf') format('opentype');
    font-display: swap;
    font-weight: 100 900;
    font-style: normal;
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF;
}

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

/* 字体变量设置 */
:root {
    --font-serif: 'Source Han Serif SC VF', 'Noto Serif CJK SC', 'Source Han Serif SC', 'Noto Serif SC', 'STSong', 'SimSun', serif;
    --font-sans: 'Source Han Sans SC VF', 'Noto Sans CJK SC', 'Source Han Sans SC', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
    /* 确保body可以接收焦点以帮助按钮失焦 */
    outline: none;
}

/* 统一的字体应用规则，桌面端和移动端完全一致 */
body.font-serif,
body.font-serif *:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not(.fass) {
    font-family: var(--font-serif) !important;
}

body.font-sans,
body.font-sans *:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not(.fass) {
    font-family: var(--font-sans) !important;
}

/* 确保 Font Awesome 图标使用正确的字体 */
.fas, .far, .fab, .fal, .fad, .fat, .fass,
[class*="fa-"]::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
    font-weight: 900 !important;
}

/* Logo and Title Styles */
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-container .home-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    height: 32px;
    width: auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: inherit;
}

/* 移动端字体渲染优化 */
@media (max-width: 768px) {
    body.font-serif,
    body.font-serif *:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not(.fass) {
        -webkit-font-feature-settings: "kern";
        font-feature-settings: "kern";
        text-rendering: optimizeLegibility;
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    body.font-sans,
    body.font-sans *:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not(.fass) {
        -webkit-font-feature-settings: "kern";
        font-feature-settings: "kern";
        text-rendering: optimizeLegibility;
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}


/* Dark mode styles */
:root {
    --bg-primary: white;
    --bg-secondary: white;
    --bg-tertiary: white;
    --text-primary: #1d1d1f;
    --text-secondary: #6b7280;
    --text-tertiary: #374151;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow: rgba(0, 0, 0, 0.1);
    --accent: #D44743;
    --accent-hover: #B73E3A;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --positive-bg: #fee2e2;
    --positive-text: #991b1b;
    --negative-bg: #dcfce7;
    --negative-text: #166534;
    --neutral-bg: #f3f4f6;
    --neutral-text: #374151;
    --user-badge: #3b82f6;
}

body.dark-mode {
    --bg-primary: #000000;
    --bg-secondary: #1f1f1f;
    --bg-tertiary: #1a1a1a;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border-color: #333333;
    --border-light: #1a1a1a;
    --shadow: rgba(0, 0, 0, 0.3);
    --accent: #E85955;
    --accent-hover: #D44743;
    --success: #34d399;
    --error: #f87171;
    --warning: #fbbf24;
    --positive-bg: #7f1d1d;
    --positive-text: #fca5a5;
    --negative-bg: #14532d;
    --negative-text: #86efac;
    --neutral-bg: #1a1a1a;
    --neutral-text: #d1d5db;
    --user-badge: #60a5fa;
}

/* 管理界面样式 */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.admin-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.admin-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.users-table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th,
.users-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.users-table tr:hover {
    background-color: var(--border-light);
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: var(--success);
    color: white;
}

.status-inactive {
    background-color: var(--error);
    color: white;
}

.status-expired {
    background-color: var(--warning);
    color: white;
}

.admin-badge {
    background-color: var(--accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.user-badge {
    background-color: var(--user-badge);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn-edit {
    background-color: #D44743;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-edit:hover {
    background-color: #B73E3A;
}

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

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

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="datetime-local"]:focus {
    outline: none;
    border-color: #D44743;
    box-shadow: 0 0 0 3px rgba(212, 71, 67, 0.1);
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.password-input-group {
    display: flex;
    gap: 0.5rem;
}

.password-input-group input {
    flex: 1;
}

.form-hint {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

.quick-date-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.quick-date-buttons .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.tab-button:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.tab-button:disabled:hover {
    background-color: #e5e7eb;
}

.hidden {
    display: none !important;
}

/* 认证界面样式 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, #764ba2 100%);
}

.auth-form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px var(--shadow);
    width: 100%;
    max-width: 400px;
}

.auth-form h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.tab-buttons {
    display: flex;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.tab-button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button.active {
    background: #D44743;
    color: white;
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #D44743;
    box-shadow: 0 0 0 3px rgba(212, 71, 67, 0.1);
}

.btn {
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

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

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--accent-hover);
}

.btn-refresh {
    background: #10b981;
    color: white;
    padding: 0.5rem 1rem;
}

.btn-refresh:hover {
    background: #059669;
}

.btn-refresh.btn-icon-only {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
    min-width: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-refresh.btn-icon-only:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-refresh.btn-icon-only:active {
    background: var(--accent-hover);
    color: #ffffff;
    border-color: var(--accent-hover);
    transition: none;
}

/* 主应用界面样式 */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.header {
    background: var(--bg-secondary);
    box-shadow: 0 1px 3px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Icon buttons (dark mode toggle, font toggle) */
.btn-icon {
    padding: 0.5rem;
    min-width: auto;
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-icon:active {
    background: var(--accent-hover);
    color: #ffffff;
    border-color: var(--accent-hover);
    transition: none;
}

.btn-icon:focus {
    outline: none;
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* 用户名点击样式 */
.user-name-clickable {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    color: var(--text-primary);
}

.user-name-clickable:hover {
    background: var(--bg-tertiary);
    color: var(--accent);
}

/* 用户信息模态框样式 */
.user-info-modal-content {
    max-width: 500px;
}

.user-info-grid {
    display: grid;
    gap: 1rem;
}

.user-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.user-info-item:last-child {
    border-bottom: none;
}

.user-info-item label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.user-info-item span {
    color: var(--text-primary);
    font-weight: 500;
}

.user-info-item .status-badge {
    margin: 0;
}

/* 字体切换按钮样式 */
#font-toggle {
    min-width: 2.5rem;
    font-weight: 600;
}

#font-display {
    font-size: 0.875rem;
}

/* logo样式 */
.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 删除老的logo样式，使用上面的新样式 */

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
}

.tab-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #D44743;
    border-bottom-color: #D44743;
}

.tab-btn:hover {
    color: #D44743;
}

.content-area {
    position: relative;
}

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

.news-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* 搜索功能样式 */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 300px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 71, 67, 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.btn-clear {
    position: absolute;
    right: 0.25rem;
    padding: 0.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0;
    visibility: hidden;
}

.search-container:hover .btn-clear,
.search-input:focus + .btn-clear {
    opacity: 1;
    visibility: visible;
}

.btn-clear:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results p {
    font-size: 1.1rem;
}

.news-list {
    display: grid;
    gap: 1rem;
}

.news-item {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    display: flex;
    gap: 1rem;
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-image {
    flex-shrink: 0;
    width: 200px;
    align-self: stretch;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    max-height: 250px;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.news-item:hover .news-image img {
    transform: scale(1.05);
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.news-source-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.news-content {
    position: relative;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.news-meta-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-meta .news-time {
    flex: none;
}

.news-time {
    font-weight: 500;
}

/* 列表中的收藏按钮样式 */
.favorite-btn-meta {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    font-weight: 500;
}

.favorite-btn-meta:hover {
    color: #ef4444;
    background: var(--bg-secondary);
    border-color: #ef4444;
    transform: translateY(-1px);
}

.favorite-btn-meta.favorited {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.favorite-btn-meta.favorited:hover {
    background: rgba(239, 68, 68, 0.15);
}

.favorite-btn-meta:focus {
    outline: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.favorite-btn-meta.favorited:focus {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.favorite-btn-meta:active {
    transform: scale(0.95);
}

/* 分享按钮样式 */
.share-btn-meta {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    font-weight: 500;
}

.share-btn-meta:hover {
    color: #3b82f6;
    background: var(--bg-secondary);
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.share-btn-meta:focus {
    outline: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.share-btn-meta:active {
    transform: scale(0.95);
}

/* 移除原来的 news-source 样式，现在使用 news-source-badge */

.news-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.news-title-cn {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
    padding-right: 6rem; /* 为右上角来源标签留出空间 */
}

.news-summary-content {
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Markdown渲染样式 */
.news-summary-content p {
    margin-bottom: 0.5rem;
}

.news-summary-content h1,
.news-summary-content h2,
.news-summary-content h3,
.news-summary-content h4,
.news-summary-content h5,
.news-summary-content h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.news-summary-content strong {
    font-weight: 600;
}

.news-summary-content em {
    font-style: italic;
}

.news-summary-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-family: monospace;
}

.news-summary-content ul,
.news-summary-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.news-summary-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin-left: 0;
    color: #6b7280;
    font-style: italic;
}

.news-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1rem;
}

.news-actions .favorite-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.news-actions .favorite-btn:hover {
    background: var(--border-light);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.news-actions .favorite-btn.favorited {
    background: var(--positive-bg);
    border-color: var(--positive-text);
    color: var(--positive-text);
}

.news-link {
    color: #D44743;
    text-decoration: none;
    font-weight: 500;
}

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

.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.2s;
    z-index: 2;
    position: relative;
}

.favorite-btn.favorited {
    color: #ef4444;
}

.favorite-btn:not(.favorited) {
    color: #d1d5db;
}

.favorite-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.no-news {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    font-size: 1.1rem;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    flex: 1;
    margin-right: 1rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.modal-summary {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #374151;
}

.modal-text {
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* 模态框中的Markdown样式 */
.modal-summary p,
.modal-text p {
    margin-bottom: 1rem;
    text-align: justify;
    text-justify: inter-ideograph;
}

.modal-summary h1,
.modal-summary h2,
.modal-summary h3,
.modal-summary h4,
.modal-summary h5,
.modal-summary h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-summary h1, .modal-text h1 { font-size: 1.5rem; }
.modal-summary h2, .modal-text h2 { font-size: 1.3rem; }
.modal-summary h3, .modal-text h3 { font-size: 1.1rem; }

.modal-summary strong,
.modal-text strong {
    font-weight: 600;
}

.modal-summary em,
.modal-text em {
    font-style: italic;
}

.modal-summary code,
.modal-text code {
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.modal-summary pre,
.modal-text pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

.modal-summary ul,
.modal-summary ol,
.modal-text ul,
.modal-text ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.modal-summary blockquote,
.modal-text blockquote {
    border-left: 4px solid #D44743;
    padding-left: 1rem;
    margin-left: 0;
    color: #6b7280;
    font-style: italic;
    background-color: #f8fafc;
    padding: 1rem 1rem 1rem 2rem;
    border-radius: 0 6px 6px 0;
    margin: 1rem 0;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    gap: 1rem;
}

/* 加载指示器 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* 消息提示 */
.error-message,
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    max-width: 400px;
}

.error-message {
    background-color: #ef4444;
}

.success-message {
    background-color: #10b981;
}

.favorite-btn:hover {
    color: #ef4444;
}

.stock-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* 新闻卡片中的股票信息 */
.news-stocks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 0.5rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.stock-tag {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.stock-tag.positive {
    background: var(--positive-bg);
    color: var(--positive-text);
}

.stock-tag.negative {
    background: var(--negative-bg);
    color: var(--negative-text);
}

.stock-tag.neutral {
    background: var(--neutral-bg);
    color: var(--neutral-text);
}

.stock-tag.more {
    background: #e5e7eb;
    color: #6b7280;
    font-style: italic;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6b7280;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-message, .success-message {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.error-message {
    background: #ef4444;
}

.success-message {
    background: #10b981;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 模态框样式 */
.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: 1rem;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px var(--shadow);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.modal-title-section {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

.favorite-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-top: 0.1rem;
}

.favorite-icon-btn:hover {
    color: #ef4444;
    background: var(--bg-tertiary);
}

.favorite-icon-btn.favorited {
    color: #ef4444;
}

.favorite-icon-btn:focus {
    outline: none;
    background: transparent;
    color: var(--text-secondary);
}

.favorite-icon-btn.favorited:focus {
    color: #ef4444;
}

.favorite-icon-btn:active {
    transform: scale(0.95);
}

/* 移动端触摸优化 */
@media (max-width: 768px) {
    .favorite-icon-btn:focus,
    .favorite-icon-btn:active,
    .favorite-btn-meta:focus,
    .favorite-btn-meta:active,
    .favorite-icon-btn-meta:focus,
    .favorite-icon-btn-meta:active {
        background: transparent !important;
        color: var(--text-secondary) !important;
    }
    
    .favorite-icon-btn.favorited:focus,
    .favorite-icon-btn.favorited:active,
    .favorite-btn-meta.favorited:focus,
    .favorite-btn-meta.favorited:active,
    .favorite-icon-btn-meta.favorited:focus,
    .favorite-icon-btn-meta.favorited:active {
        color: #ef4444 !important;
    }
}

.modal-title-cn {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.4;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-meta {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* 模态框中的收藏按钮样式 */
.favorite-icon-btn-meta {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    font-weight: 500;
}

.favorite-icon-btn-meta:hover {
    color: #ef4444;
    background: var(--bg-secondary);
    border-color: #ef4444;
    transform: translateY(-1px);
}

.favorite-icon-btn-meta.favorited {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.favorite-icon-btn-meta.favorited:hover {
    background: rgba(239, 68, 68, 0.15);
}

.favorite-icon-btn-meta:focus {
    outline: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.favorite-icon-btn-meta.favorited:focus {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.favorite-icon-btn-meta:active {
    transform: scale(0.95);
}

/* 截图按钮特殊样式 */
.favorite-icon-btn-meta i.fa-camera {
    color: var(--text-secondary);
}

.favorite-icon-btn-meta:hover i.fa-camera {
    color: #3b82f6;
}

.favorite-icon-btn-meta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.favorite-icon-btn-meta:disabled:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    transform: none;
}


.modal-summary {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent);
    font-weight: 400;
    line-height: 1.8;
    color: var(--text-primary);
}

.modal-content-section {
    margin-bottom: 1.5rem;
}

.modal-content-section h1 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-text {
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: justify;
    text-justify: inter-ideograph;
}

.modal-text h1,
.modal-text h2,
.modal-text h3,
.modal-text h4,
.modal-text h5,
.modal-text h6 {
    margin: 1.5rem 0 1rem 0;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-text h1 { font-size: 1.5rem; }
.modal-text h2 { font-size: 1.375rem; }
.modal-text h3 { font-size: 1.25rem; }
.modal-text h4 { font-size: 1.125rem; }

.modal-text p {
    margin-bottom: 1rem;
    text-align: justify;
    text-justify: inter-ideograph;
}

.modal-text a {
    color: #D44743;
    text-decoration: underline;
}

.modal-text a:hover {
    color: #B73E3A;
}

.modal-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem auto;
    display: block;
}

/* 图片错误处理样式 */
.image-error {
    background-color: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 2rem;
    margin: 1rem 0;
    text-align: center;
    color: #6b7280;
}

.image-error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.image-error-icon {
    font-size: 2rem;
    opacity: 0.5;
}

.image-error-text {
    font-weight: 500;
    color: #374151;
}

.image-error-url {
    font-size: 0.875rem;
    color: #6b7280;
    word-break: break-all;
    max-width: 100%;
}

.image-retry-btn {
    background-color: #D44743;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    transition: background-color 0.2s;
}

.image-retry-btn:hover {
    background-color: #B73E3A;
}

.modal-text em {
    color: #6b7280;
    font-style: italic;
}

.modal-text strong {
    font-weight: 600;
}

.modal-text blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6b7280;
    font-style: italic;
}

.modal-text ul,
.modal-text ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-text li {
    margin-bottom: 0.5rem;
}

.modal-stock-info {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.ai-analysis-section {
    background: linear-gradient(135deg, rgba(212, 71, 67, 0.03) 0%, rgba(183, 62, 58, 0.03) 100%);
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(212, 71, 67, 0.08);
}

.ai-analysis-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 71, 67, 0.2) 0%, rgba(183, 62, 58, 0.2) 100%);
    border-radius: 12px;
    padding: 2px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1;
}

.ai-analysis-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(212, 71, 67, 0.15);
}

.ai-analysis-section h4 i {
    color: #D44743;
    font-size: 1rem;
    background: linear-gradient(135deg, #D44743 0%, #B73E3A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-summary-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    text-align: justify;
    text-justify: inter-ideograph;
}

.analysis-divider {
    margin: 1.5rem 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 71, 67, 0.3) 50%, transparent 100%);
}

.ai-summary-content p {
    margin-bottom: 0.875rem;
    text-align: justify;
    text-justify: inter-ideograph;
}

.ai-summary-content p:last-child {
    margin-bottom: 0;
}

.ai-summary-content ul, 
.ai-summary-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.875rem;
}

.ai-summary-content li {
    margin-bottom: 0.3rem;
}

.ai-summary-content strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* No analysis message styling */
.no-analysis {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
    background: rgba(107, 114, 128, 0.05);
    border-radius: 8px;
    margin: 0;
}

/* Dark mode support for no-analysis */
body.dark-mode .no-analysis {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

/* Investment disclaimer styles */
.investment-disclaimer {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    margin: 1rem 0;
    line-height: 1.4;
}

/* Dark mode support for disclaimer */
body.dark-mode .investment-disclaimer {
    color: #6b7280;
}

/* 新闻导航按钮 */
.news-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

/* 隐藏状态的导航按钮 */
.news-nav-btn.nav-hidden {
    opacity: 0.2;
    /* 保留点击事件，这样隐藏状态下仍可点击来显示 */
    pointer-events: auto;
}

/* 移动端的特殊处理 */
@media (max-width: 768px) {
    .news-nav-btn.nav-hidden {
        opacity: 0.1;
    }
    
    .news-nav-btn {
        width: 45px;
        height: 45px;
        background: rgba(255, 255, 255, 0.8);
    }
    
    .prev-btn {
        left: 15px;
    }
    
    .next-btn {
        right: 15px;
    }
}

.news-nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.news-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.news-nav-btn:disabled:hover {
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.news-nav-btn i {
    color: var(--text-primary);
    font-size: 18px;
}

/* 深色模式下的导航按钮 */
body.dark-mode .news-nav-btn {
    background: rgba(30, 30, 30, 0.9);
    border-color: var(--border-color);
}

body.dark-mode .news-nav-btn:hover {
    background: rgba(30, 30, 30, 1);
}

body.dark-mode .news-nav-btn:disabled:hover {
    background: rgba(30, 30, 30, 0.9);
}

/* 深色模式下的隐藏状态 */
body.dark-mode .news-nav-btn.nav-hidden {
    opacity: 0.15;
}

@media (max-width: 768px) {
    body.dark-mode .news-nav-btn.nav-hidden {
        opacity: 0.08;
    }
    
    body.dark-mode .news-nav-btn {
        background: rgba(30, 30, 30, 0.8);
    }
}

/* 模态框头部控件 */
.modal-header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}


/* 防止背景滚动 */
body.modal-open {
    overflow: hidden;
}

.modal-references {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.modal-references h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.reference-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reference-item {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.reference-link {
    color: #000000;
    text-decoration: none;
    font-weight: 500;
    display: block;
    line-height: 1.4;
}

.reference-link:hover {
    color: #333333;
    text-decoration: underline;
}

.reference-link.original-link {
    color: #000000;
    font-weight: 600;
}

.reference-link.original-link:hover {
    color: #333333;
}

.reference-link.original-link i {
    margin-right: 0.5rem;
}

.modal-stock-info h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stock-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stock-item {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.stock-header {
    margin-bottom: 0.5rem;
}

.stock-reason {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.modal-footer .btn {
    flex: 1;
}

.no-data {
    text-align: center;
    color: #6b7280;
    padding: 3rem 1rem;
    font-style: italic;
}

/* 权限过期页面样式 */
.permission-expired-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.permission-expired-content {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.expired-icon {
    font-size: 4rem;
    color: #f59e0b;
    margin-bottom: 1.5rem;
}

.permission-expired-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.expired-info {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 1rem;
    font-weight: 500;
}

.expired-message {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.expired-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

/* 退出按钮图标样式 - 与其他图标按钮一致 */
.btn-secondary.btn-icon-only {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
    min-width: auto;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary.btn-icon-only:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-secondary.btn-icon-only:active {
    background: var(--accent-hover);
    color: #ffffff;
    border-color: var(--accent-hover);
    transition: none;
}

.btn-secondary.btn-icon-only:focus {
    outline: none;
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* 用户信息区域样式调整 */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 移动端触摸高亮控制 - 强制覆盖 */
.btn-icon,
.btn-secondary.btn-icon-only,
button {
    -webkit-tap-highlight-color: transparent !important;
    tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* 强制重置按钮焦点状态 - 移动端 */
@media (max-width: 768px) {
    .btn-icon:focus,
    .btn-icon:active,
    .btn-secondary.btn-icon-only:focus,
    .btn-secondary.btn-icon-only:active {
        background: transparent !important;
        color: var(--text-secondary) !important;
        border-color: var(--border-color) !important;
        outline: none !important;
        box-shadow: none !important;
    }
    
    .btn-icon:hover,
    .btn-secondary.btn-icon-only:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--text-secondary) !important;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .main-content {
        padding: 1rem 1rem;
        margin: 0 auto;
        box-sizing: border-box;
    }
    
    .header-content {
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    /* 保持标签横向排布 */
    .tab-container {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tab-container::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: auto;
        font-size: 0.875rem;
    }
    
    /* 用户信息区域在移动端的布局 */
    .user-info {
        justify-content: flex-end;
        gap: 0.25rem;
        flex-shrink: 0;
    }
    
    .user-info .btn-icon,
    .user-info .btn-icon-only {
        padding: 0.375rem;
        font-size: 0.875rem;
        width: 2.25rem;
        height: 2.25rem;
        min-width: 2.25rem;
    }
    
    /* 字体切换按钮特殊处理 - 确保与其他按钮一致 */
    .user-info #font-toggle {
        padding: 0.375rem;
        font-size: 0.875rem;
        width: 2.25rem !important;
        height: 2.25rem !important;
        min-width: 2.25rem !important;
        max-width: 2.25rem !important;
    }
    
    /* 移动端logo调整 */
    .logo-container {
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    
    .news-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-controls {
        flex-direction: row;
        width: 100%;
        gap: 0.75rem;
        align-items: center;
    }
    
    .search-container {
        flex: 1;
    }
    
    .search-input {
        width: 100%;
    }
    
    /* 移动端新闻卡片布局 */
    .news-item {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .news-image {
        width: 100%;
        height: 120px;
        order: -1;
    }
    
    .auth-form {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .permission-expired-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .expired-actions {
        flex-direction: column;
    }
}

/* 加载更多指示器 */
.load-more-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    margin: 20px auto;
    max-width: 200px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s ease;
    font-size: 14px;
}

.load-more-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Dark mode support for load-more indicator */
body.dark-mode .load-more-indicator {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .reference-link {
    color: #ffffff;
}

body.dark-mode .reference-link:hover {
    color: #cccccc;
}

body.dark-mode .reference-link.original-link {
    color: #ffffff;
}

body.dark-mode .reference-link.original-link:hover {
    color: #cccccc;
}

.load-more-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 新闻详情页面样式 */
.news-detail-container {
    max-width: 675px;
    margin: 0 auto;
    padding: 1rem 0;
}


.news-detail-title-section {
    text-align: center;
    min-width: 0;
    margin-bottom: 2rem;
}


/* 详情页面按钮样式 - 与首页刷新按钮保持一致 */
.btn-detail-nav {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
    min-width: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.btn-detail-nav:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-detail-nav:active {
    background: var(--accent-hover);
    color: #ffffff;
    border-color: var(--accent-hover);
    transition: none;
}

.btn-detail-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-detail-nav:disabled:hover {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-detail-nav:focus {
    outline: none;
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* 移动端触摸优化 */
@media (max-width: 768px) {
    .btn-detail-nav:focus,
    .btn-detail-nav:active {
        background: transparent !important;
        color: var(--text-secondary) !important;
        border-color: var(--border-color) !important;
        outline: none !important;
        box-shadow: none !important;
    }
    
    .btn-detail-nav:hover {
        background: var(--accent) !important;
        color: #ffffff !important;
        border-color: var(--accent) !important;
    }
    
    .btn-detail-nav {
        width: 2.25rem;
        height: 2.25rem;
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

.news-detail-content {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.news-detail-header-info {
    margin-bottom: 2rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.news-detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    color: var(--text-primary);
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-detail-title-cn {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0.25rem 0 0 0;
    color: var(--text-secondary);
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.news-detail-summary {
    margin-bottom: 2rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.news-detail-main-content {
    margin-bottom: 2rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.news-detail-main-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-detail-text {
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: justify;
    text-justify: inter-ideograph;
}

.news-detail-text p {
    margin-bottom: 1rem;
    text-align: justify;
    text-justify: inter-ideograph;
}

.news-detail-text h1,
.news-detail-text h2,
.news-detail-text h3,
.news-detail-text h4,
.news-detail-text h5,
.news-detail-text h6 {
    margin: 1.5rem 0 1rem 0;
    font-weight: 600;
    color: var(--text-primary);
}

.news-detail-text h1 { font-size: 1.5rem; }
.news-detail-text h2 { font-size: 1.375rem; }
.news-detail-text h3 { font-size: 1.25rem; }
.news-detail-text h4 { font-size: 1.125rem; }

.news-detail-text a {
    color: #D44743;
    text-decoration: underline;
}

.news-detail-text a:hover {
    color: #B73E3A;
}

.news-detail-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem auto;
    display: block;
}

.news-detail-text ul,
.news-detail-text ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.news-detail-text li {
    margin-bottom: 0.5rem;
}

.news-detail-text blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6b7280;
    font-style: italic;
}

.news-detail-stock-info {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 1.5rem;
}

.news-detail-stock-info h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.news-detail-references {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.news-detail-references h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 悬浮导航按钮 */
.floating-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    opacity: 0.3;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-nav-btn:hover {
    opacity: 0.9 !important;
    background: rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.floating-nav-btn:disabled {
    opacity: 0.1;
    cursor: not-allowed;
    pointer-events: none;
}

.floating-nav-left {
    left: 20px;
}

.floating-nav-right {
    right: 20px;
}

/* 黑暗模式下的悬浮按钮 */
body.dark-mode .floating-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.dark-mode .floating-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 0.9 !important;
}

/* 详情页面字体确保与主页完全一致 */

/* 新闻列表移动端样式 */
@media (max-width: 768px) {
    .news-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .news-meta-right {
        flex-shrink: 0;
    }
    
    .news-time {
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .news-source-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

/* 移动端响应式 */
@media (max-width: 768px) {
    /* 移动端悬浮按钮调整 */
    .floating-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .floating-nav-left {
        left: 10px;
    }
    
    .floating-nav-right {
        right: 10px;
    }

    .news-detail-container {
        padding: 0.5rem 0;
        max-width: 100%;
    }
    
    .news-detail-content {
        padding: 0;
        margin: 0;
        border-radius: 0;
    }
    
    
    .news-detail-title-section {
        min-width: 0;
        overflow: hidden;
    }
    
    
    .news-detail-title {
        font-size: 1.2rem;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.4;
    }
    
    .news-detail-title-cn {
        font-size: 1rem;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.4;
    }
    
    /* 极小屏幕时的标题样式优化 */
    @media (max-width: 480px) {
        .news-detail-title {
            font-size: 1.1rem;
            line-height: 1.3;
        }
        
        .news-detail-title-cn {
            font-size: 0.95rem;
            line-height: 1.3;
        }
        
        .news-detail-header {
            gap: 0.5rem;
        }
        
        .news-detail-title {
            font-size: 1.1rem;
        }
        
        .news-detail-title-cn {
            font-size: 0.95rem;
        }
    }
    
    .news-detail-meta {
        justify-content: center;
    }
    
    .news-detail-header-info,
    .news-detail-summary,
    .news-detail-main-content,
    .news-detail-stock-info,
    .news-detail-references {
        margin-left: 1rem;
        margin-right: 1rem;
        padding: 0;
    }
}