:root {
    --primary: #1B2631;
    --accent: #C0392B;
    --bg: #F8F9FA;
    --font-size-adjust: -0.125rem;
}

body {
    font-family: -apple-system, "Helvetica Neue", "Microsoft YaHei", sans-serif;
    margin: 0;
    background: var(--bg);
    color: #333;
    line-height: 1.6;
}

/* 布局 */
.header {
    background: var(--primary);
    color: white;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 15px;
}

.left-col {
    flex: 3;
}

.right-col {
    flex: 1;
}

/* 新闻卡片 */
/* 频道标签卡 */
.channel-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    padding: 8px;
    background: var(--bg);
    border-radius: 8px 8px 0 0;
}

.channel-tab {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: calc(0.95rem + var(--font-size-adjust));
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.channel-tab.active {
    background: #fff;
    color: #333;
}

.channel-tab:not(.active):not(.disabled) {
    background: var(--bg);
    color: #666;
}

.channel-tab:not(.active):not(.disabled):hover {
    background: #f0f0f0;
}

.channel-tab.disabled {
    background: var(--bg);
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.summary-box {
    background: #fff;
    padding: 24px 20px;
    border-radius: 8px;
    margin-top: 0;
    margin-bottom: 20px;
    border-left: 5px solid var(--accent);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.section-header h3 {
    margin: 0;
    flex: 1;
}

.home-btn {
    padding: 4px 10px;
    background: transparent;
    color: var(--primary);
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    font-size: calc(0.85rem + var(--font-size-adjust));
    cursor: pointer;
    display: inline-block;
    white-space: nowrap;
    height: fit-content;
    align-self: center;
    margin-top: -8px;
    transition: all 0.3s ease;
}

.home-btn:hover {
    background: #f5f5f5;
    border-color: var(--primary);
}

.update-info {
    font-size: calc(0.8rem + var(--font-size-adjust));
    color: #888;
    margin-top: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.update-time {
    font-size: calc(0.8rem + var(--font-size-adjust));
    color: #888;
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.news-item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    gap: 20px;
}

.news-content {
    flex: 2.5;
    position: relative;
    padding-bottom: 30px;
}

.news-links {
    flex: 1.7;
    border-left: 1px solid #eee;
    padding-left: 20px;
    font-size: calc(0.9rem + var(--font-size-adjust));
}

.topic-name {
    font-size: calc(1.3rem + var(--font-size-adjust));
    margin: 0 0 10px 0;
    color: var(--primary);
}

.briefing-with-image {
    margin: 0;
}

.briefing-with-image::after {
    content: "";
    display: table;
    clear: both;
}

.news-item-image {
    float: right;
    width: 110px;
    height: 110px;
    object-fit: cover;
    object-position: center;
    margin: 0 0 8px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.article-source {
    font-size: calc(0.85rem + var(--font-size-adjust));
    color: #888;
}

.article-link-row {
    margin-bottom: 8px;
}

.article-link {
    text-decoration: none;
    color: #2980B9;
}

.update-link {
    color: #2980B9;
    text-decoration: none;
}

/* 右栏模块样式 */
/* 快速操作条 - 顶部嵌入式 */
.quick-actions {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 10px 8px;
    margin-bottom: 0;
    background: var(--bg);
    border-radius: 8px 8px 0 0;
    align-items: center;
    min-height: 38px;
}

.right-module {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.right-col > .right-module:first-of-type {
    margin-top: 0;
}

.module-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.module-title {
    font-size: calc(1.1rem + var(--font-size-adjust));
    font-weight: bold;
    color: var(--primary);
    margin: 0;
}

/* 用户名微调 */
.username-area {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: calc(0.85rem + var(--font-size-adjust));
    color: #666;
}

.username-badge {
    background: transparent;
    color: #333;
    padding: 0;
    border-radius: 0;
    font-weight: normal;
}

.btn-edit-sm {
    font-size: calc(0.8rem + var(--font-size-adjust));
    padding: 0;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    transform: scaleX(-1);
    display: inline-block;
}

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

.username-edit-inline {
    display: none;
    align-items: center;
    gap: 3px;
}

.username-edit-inline input {
    font-size: calc(0.8rem + var(--font-size-adjust));
    padding: 2px 5px;
    width: 80px;
    margin: 0;
    border: 1px solid #ddd;
}

.btn-confirm-sm {
    color: #27ae60;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 0 2px;
    font-size: calc(0.8rem + var(--font-size-adjust));
}

.btn-cancel-sm {
    color: #e74c3c;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 0 2px;
    font-size: calc(0.8rem + var(--font-size-adjust));
}

/* 列表样式 */
.hanging-list {
    list-style: none;
    padding-left: 1.2em;
    margin: 0;
}

.hanging-list li {
    text-indent: -0.8em;
    margin-bottom: 6px;
    line-height: 1.6;
    font-size: calc(0.85rem + var(--font-size-adjust));
    color: #666;
}

.hanging-list li::before {
    content: "• ";
    color: var(--primary);
}

/* 按钮与表单 */
.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.btn-header {
    background: transparent;
    border: 1px solid white;
    padding: 4px 8px;
    font-size: calc(0.8rem + var(--font-size-adjust));
    color: white;
}

.btn-full {
    width: 100%;
}

input[type="email"],
textarea,
select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 4px rgba(27,38,49,0.1);
}

/* 快速操作栏 */
.action-link {
    font-size: calc(0.85rem + var(--font-size-adjust));
    color: #888;
    text-decoration: none;
    cursor: pointer;
}

.action-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* 分享按钮 */
.share-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0.45;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.share-btn:hover {
    opacity: 0.85;
}

.news-content .share-btn {
    position: absolute;
    bottom: 4px;
    right: 0;
}

/* 今日要闻模块底部行：时间 + 导航 + 分享按钮 */
.summary-footer {
    display: block;
    padding-bottom: 4px;
}

.summary-footer .update-time {
    margin-top: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.summary-footer .update-time .share-btn {
    margin-left: auto;
}

/* 弹窗提示 */
.share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(27,38,49,0.92);
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: calc(0.9rem + var(--font-size-adjust));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    width: max-content;
    max-width: min(420px, calc(100vw - 30px));
    white-space: normal;
    text-align: center;
}

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

/* 日历样式 */
.calendar-container {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    font-size: calc(0.9rem + var(--font-size-adjust));
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.calendar-nav-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: calc(0.8rem + var(--font-size-adjust));
    font-weight: bold;
    transition: background 0.2s;
}

.calendar-nav-btn:hover {
    background: #294156;
}

.calendar-month-display {
    font-weight: bold;
    color: var(--primary);
    font-size: calc(0.9rem + var(--font-size-adjust));
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-weight: bold;
    font-size: calc(0.65rem + var(--font-size-adjust));
    color: #666;
    padding: 3px 0;
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px;
    font-size: calc(0.7rem + var(--font-size-adjust));
    cursor: default;
    background: white;
    transition: all 0.2s;
}

.calendar-cell.other-month {
    color: #ccc;
    background: #f0f0f0;
}

.calendar-cell.active {
    background: #2980B9;
    color: white;
    font-weight: bold;
    cursor: pointer;
    border-color: #2980B9;
}

.calendar-cell.active:hover {
    background: #1e5f9e;
    box-shadow: 0 2px 5px rgba(41, 128, 185, 0.3);
}

.calendar-cell.disabled {
    color: #ccc;
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.calendar-cell.today.disabled {
    background: #f5f5f5 !important;
    color: #333;
    font-weight: bold;
    opacity: 0.6;
    border: 2px solid var(--accent);
}

/* 快照警告条 */
.snapshot-warning {
    background: #e8f4f8;
    border-left: 4px solid #2980B9;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #1B2631;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.snapshot-warning-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: calc(1.2em + var(--font-size-adjust));
    flex-shrink: 0;
}

.snapshot-warning-text {
    flex: 1;
}

.snapshot-back-btn {
    background: #2980B9;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: calc(0.8rem + var(--font-size-adjust));
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
    flex-shrink: 0;
}

.snapshot-back-btn:hover {
    background: #1e5f9e;
}

/* 重定向页面样式 */
.redirect-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.source-text {
    font-size: calc(1rem + var(--font-size-adjust));
    color: #888;
    margin-bottom: 8px;
    font-weight: normal;
}

.article-title {
    font-size: calc(1.6rem + var(--font-size-adjust));
    font-weight: bold;
    color: var(--primary);
    margin: 15px 0 30px 0;
    line-height: 1.4;
}

.status-message {
    padding: 15px 20px;
    background: #F0F4F8;
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    margin: 20px 0;
    font-size: calc(0.95rem + var(--font-size-adjust));
    color: #333;
    line-height: 1.6;
}

.status-message.unreachable {
    background: #FDE8E8;
    border-left-color: #e74c3c;
    color: #c0392b;
}

.btn-group {
    display: flex;
    gap: 32px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-copy {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: calc(0.95rem + var(--font-size-adjust));
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #0f1815;
}

.btn-copy:active {
    transform: scale(0.98);
}

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

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(27,38,49,0.92);
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: calc(0.9rem + var(--font-size-adjust));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    width: max-content;
    max-width: min(420px, calc(100vw - 30px));
    white-space: normal;
    text-align: center;
}

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

/* 表单消息 */
.form-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.comment-list {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

/* 响应式 */
@media (max-width: 850px) {
    :root {
        --font-size-adjust: 0.125rem;
    }

    .container {
        flex-direction: column;
        gap: 2px;
    }

    .news-item {
        flex-direction: column;
        gap: 8px;
    }

    .news-links {
        border-left: none;
        border-top: 1px solid #eee;
        padding: 15px 0 0 0;
    }

    .left-col > .summary-box {
        margin-top: 0;
    }

    .summary-box {
        padding-bottom: 10px;
        margin-bottom: 2px;
    }

    .redirect-card {
        padding: 20px;
    }

    .article-title {
        font-size: calc(1.4rem + var(--font-size-adjust));
    }

    .section-header h3 {
        font-size: 1.3rem;
    }

    .summary-box > p,
    .news-content > p {
        font-size: calc(1rem + 0.0625rem);
    }

    .quick-actions {
        margin-bottom: 20px;
    }

    .right-col > .right-module:first-of-type {
        margin-top: 0;
    }
}

/* 热点快照页面样式 */
.summary-box-hour {
    border-left-color: #4CAF50;
}

/* 导航图标样式 */
.nav-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 6px 0 0;
    padding: 0;
    text-decoration: none;
    transition: opacity 0.2s ease;
    opacity: 0.7;
    color: #2980B9;
    vertical-align: middle;
}

.nav-icon-link:visited {
    color: #2980B9;
}

.nav-icon-link:hover:not(.nav-icon-disabled) {
    opacity: 1;
}

.nav-icon-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
    stroke: currentColor;
}
