/* ============================================
   保密宣传教育平台 - 警用蓝主题
   仿学习强国 UI 风格
   ============================================ */

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    color: #333;
    background: #f0f4f8;
    overflow-x: hidden;
}

/* ---------- 页面容器 ---------- */
.page {
    display: none;
    width: 100%;
    min-height: 100vh;
    background: #f0f4f8;
    animation: fadeIn 0.25s ease;
}

.page.active {
    display: block;
}

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

/* ---------- 登录页 ---------- */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, #0a2351 0%, #1a3c6e 40%, #2b5ea7 100%);
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(255,255,255,0.2));
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.login-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-top: 8px;
    letter-spacing: 3px;
}

.login-form {
    width: 100%;
    max-width: 360px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 28px 24px;
    border: 1px solid rgba(255,255,255,0.15);
}

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

.form-group label {
    display: block;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    background: rgba(255,255,255,0.92);
    color: #333;
    outline: none;
    transition: box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.4);
}

.form-group input::placeholder {
    color: #aaa;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #3b7dd8, #1a5fc7);
    color: #fff;
    box-shadow: 0 4px 14px rgba(26, 60, 110, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(26, 60, 110, 0.45);
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #3b7dd8;
    color: #3b7dd8;
}

.btn-success {
    background: #1e8e3e;
    color: #fff;
}

.btn-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ---------- 主页面头部 ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #0a2351, #1a3c6e);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-left {
    font-size: 14px;
    font-weight: 500;
}

.header-center {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 2px;
}

.header-right {
    font-size: 14px;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ---------- 页面头部 (子页面) ---------- */
.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #0a2351, #1a3c6e);
    color: #fff;
}

.back-btn {
    font-size: 28px;
    line-height: 1;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0 4px;
    font-weight: 300;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
}

.page-points-hint {
    font-size: 12px;
    background: rgba(255,255,255,0.2);
    padding: 2px 10px;
    border-radius: 12px;
}

.page-content {
    padding: 16px;
    padding-bottom: 80px;
}

/* ---------- 今日积分卡片 ---------- */
.points-card {
    position: relative;
    margin: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #1a3c6e, #2b5ea7);
    border-radius: 14px;
    color: #fff;
    box-shadow: 0 4px 16px rgba(26, 60, 110, 0.25);
}

.points-card-left {
    display: inline-block;
}

.points-today-label {
    font-size: 13px;
    opacity: 0.8;
}

.points-today-num {
    display: inline;
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
}

.points-today-max {
    display: inline;
    font-size: 16px;
    opacity: 0.7;
    margin-left: 2px;
}

.points-card-right {
    float: right;
    text-align: right;
}

.points-month-label {
    font-size: 13px;
    opacity: 0.8;
}

.points-month-num {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
}

.points-rank-link {
    font-size: 12px;
    color: #ffd54f;
    cursor: pointer;
    margin-top: 4px;
}

.points-rank-link:active {
    opacity: 0.7;
}

.points-progress-bar {
    clear: both;
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    margin-top: 14px;
    overflow: hidden;
}

.points-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd54f, #ffb300);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ---------- 快捷统计 ---------- */
.quick-stats {
    display: flex;
    margin: 0 16px 16px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1a3c6e;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* ---------- 模块网格 ---------- */
.module-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px 16px;
}

.module-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 14px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: relative;
}

.module-card:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.module-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 10px;
}

.module-name {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 3px;
}

.module-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.module-points {
    font-size: 11px;
    color: #2b5ea7;
    font-weight: 500;
}

/* ---------- 提示横幅 ---------- */
.tip-banner {
    margin: 0 16px 80px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
    border-radius: 10px;
    font-size: 13px;
    color: #1a3c6e;
    text-align: center;
    border-left: 3px solid #1a3c6e;
}

/* ---------- 底部导航 ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding: 6px 0;
    padding-bottom: env(safe-area-inset-bottom, 6px);
    z-index: 200;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 11px;
    color: #999;
}

.nav-item.active .nav-label {
    color: #1a3c6e;
    font-weight: 600;
}

.nav-item:active {
    opacity: 0.6;
}

/* ---------- 列表项 ---------- */
.list-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.1s;
}

.list-item:active {
    transform: scale(0.99);
}

.list-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    line-height: 1.4;
}

.list-item-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

.list-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.list-item-tag {
    font-size: 11px;
    background: #e8f0fe;
    color: #1a3c6e;
    padding: 2px 10px;
    border-radius: 10px;
}

.list-item-badge {
    font-size: 12px;
    color: #2b5ea7;
    font-weight: 500;
}

.list-item-status {
    font-size: 12px;
    color: #1e8e3e;
    font-weight: 500;
}

.list-item-status.done {
    color: #1e8e3e;
}

/* ---------- 法规详情 ---------- */
.law-detail {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.law-detail h2 {
    font-size: 20px;
    color: #1a3c6e;
    margin-bottom: 16px;
    line-height: 1.4;
}

.law-detail .law-meta {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.law-detail .law-body {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}

.law-detail .law-body p {
    margin-bottom: 12px;
    text-indent: 2em;
}

.law-read-btn {
    margin-top: 20px;
    text-align: center;
}

/* ---------- 视频卡片 ---------- */
.video-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.video-thumb {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #1a3c6e, #0a2351);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.video-thumb .play-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid rgba(255,255,255,0.4);
    transition: transform 0.2s;
}

.video-thumb:active .play-icon {
    transform: scale(1.1);
}

.video-thumb .video-duration {
    position: absolute;
    bottom: 8px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.video-info {
    padding: 14px;
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}

.video-desc {
    font-size: 13px;
    color: #888;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

/* ---------- 答题 ---------- */
.quiz-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.quiz-question-num {
    font-size: 13px;
    color: #2b5ea7;
    font-weight: 600;
    margin-bottom: 10px;
}

.quiz-question {
    font-size: 16px;
    font-weight: 500;
    color: #222;
    margin-bottom: 16px;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    padding: 12px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.quiz-option:active {
    transform: scale(0.99);
}

.quiz-option.selected {
    border-color: #2b5ea7;
    background: #e8f0fe;
    color: #1a3c6e;
    font-weight: 500;
}

.quiz-option.correct {
    border-color: #1e8e3e;
    background: #e6f4ea;
    color: #1e8e3e;
}

.quiz-option.wrong {
    border-color: #d93025;
    background: #fce8e6;
    color: #d93025;
}

.quiz-result {
    text-align: center;
    padding: 40px 20px;
}

.quiz-result-score {
    font-size: 48px;
    font-weight: 800;
    color: #1a3c6e;
}

.quiz-result-label {
    font-size: 16px;
    color: #888;
    margin-top: 8px;
}

.quiz-result-detail {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

/* ---------- 学习心得 ---------- */
.note-form {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.note-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.note-form textarea:focus {
    border-color: #3b7dd8;
}

.note-form textarea::placeholder {
    color: #bbb;
}

.note-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.note-hint {
    font-size: 12px;
    color: #aaa;
}

.note-item {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.note-item-content {
    font-size: 14px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 8px;
}

.note-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #aaa;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state .empty-text {
    font-size: 14px;
}

/* ---------- 排行榜 ---------- */
.ranking-tabs {
    display: flex;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.rank-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f5f5f5;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.rank-tab.active {
    background: #1a3c6e;
    color: #fff;
    font-weight: 600;
}

.rank-month-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    text-align: center;
}

.rank-list-item {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.rank-number {
    width: 28px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: #999;
}

.rank-number.top1 { color: #ff6f00; }
.rank-number.top2 { color: #78909c; }
.rank-number.top3 { color: #8d6e63; }

.rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3c6e, #3b7dd8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    margin: 0 12px;
    flex-shrink: 0;
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-name {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

.rank-dept {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.rank-points {
    font-size: 18px;
    font-weight: 700;
    color: #1a3c6e;
}

.rank-points-label {
    font-size: 11px;
    color: #aaa;
    text-align: right;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0,0,0,0.78);
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    max-width: 80%;
    text-align: center;
    backdrop-filter: blur(4px);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* ---------- 响应式 ---------- */
@media (min-width: 480px) {
    .module-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .page-content {
        max-width: 600px;
        margin: 0 auto;
    }
    .points-card {
        max-width: 600px;
        margin: 16px auto;
    }
    .quick-stats {
        max-width: 600px;
        margin: 0 auto 16px;
    }
    .module-grid {
        max-width: 600px;
        margin: 0 auto;
    }
    .tip-banner {
        max-width: 600px;
        margin: 0 auto 80px;
    }
}

/* ---------- 视频弹窗 ---------- */
.video-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.video-player-box {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
}

.video-player-box .video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a3c6e, #0a2351);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    font-size: 48px;
}

.video-player-box .video-playing-title {
    color: #fff;
    font-size: 16px;
    margin-top: 16px;
}

.video-player-box .video-close-btn {
    margin-top: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    padding: 10px 32px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.toast{
    position:fixed;
    left:50%;
    top:40%;
    transform:translate(-50%,-50%);
    background:rgba(0,0,0,0.75);
    color:#fff;
    padding:10px 20px;
    border-radius:6px;
    z-index:9999;
    display:none;
}
.toast.show{
    display:block;
}
.note-input-wrap{
    padding:12px;
}
.note-input-wrap textarea{
    width:100%;
    min-height:120px;
    box-sizing:border-box;
    padding:8px;
}
.article-card{
    padding:12px;
    border-bottom:1px solid #eee;
}
