/* ============================================================
   粹兵2026 全民防衛推廣進度管理系統 - 自訂樣式 v2.0
   style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;600;700;800&display=swap');

:root {
    /* 粹兵2026 軍事色系 */
    --army-dark:   #0d1b2a;
    --army-mid:    #1b2838;
    --army-green:  #2d6a4f;
    --army-green2: #40916c;
    --army-gold:   #d4a017;
    --army-gold2:  #f0c040;
    --army-red:    #8b1a1a;

    /* 一般設計 Token */
    --primary:    #1a56db;
    --primary-dk: #1241a3;
    --success:    #057a55;
    --warning:    #c27803;
    --danger:     #c81e1e;
    --secondary:  #6b7280;

    /* 介面 */
    --navbar-h:   112px;  /* topbar(36px) + navbar(60px) + gap */
    --bg:         #f0f4f8;
    --card-bg:    #ffffff;
    --border:     #e2e8f0;
    --text:       #1e293b;
    --text-muted: #64748b;
    --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
    --shadow-lg:  0 10px 25px rgba(0,0,0,.12);
    --radius:     10px;
    --transition: all .2s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-size: 14px;
    padding-top: var(--navbar-h);
}

/* ══════════════════════════════════════════════════════════
   頂部倒數計時公告欄
   ══════════════════════════════════════════════════════════ */
.topbar-countdown {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 36px;
    background: linear-gradient(90deg, #0d1b2a 0%, #1b4332 50%, #0d1b2a 100%);
    border-bottom: 1px solid rgba(212,160,23,.4);
    z-index: 1031;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: rgba(232,237,242,.8);
    letter-spacing: .5px;
    overflow: hidden;
}
.topbar-countdown::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 60px,
        rgba(212,160,23,.03) 60px,
        rgba(212,160,23,.03) 61px
    );
}
.topbar-label {
    font-weight: 700;
    color: var(--army-gold);
    letter-spacing: 2px;
    font-size: .8rem;
}
.topbar-divider {
    width: 1px; height: 14px;
    background: rgba(212,160,23,.4);
}
.topbar-days {
    display: flex;
    align-items: baseline;
    gap: 2px;
}
.cd-num {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--army-gold);
    font-variant-numeric: tabular-nums;
    min-width: 2ch;
    text-align: right;
    line-height: 1;
}
.cd-unit {
    font-size: .7rem;
    color: rgba(212,160,23,.7);
}
.cd-time-mini {
    font-size: .7rem;
    color: rgba(232,237,242,.5);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

/* ══════════════════════════════════════════════════════════
   主導覽列
   ══════════════════════════════════════════════════════════ */
#mainNavbar {
    position: fixed;
    top: 36px; left: 0; right: 0;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 60%, #0d1b2a 100%);
    border-bottom: 1px solid rgba(212,160,23,.25);
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    z-index: 1030;
    min-height: 60px;
}
#mainNavbar::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,160,23,.5), transparent);
}

.nav-emblem {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #1b4332, #2d6a4f);
    border: 1px solid rgba(212,160,23,.5);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(212,160,23,.2);
}
.navbar-brand { text-decoration: none !important; }
.nav-brand-title {
    font-size: .95rem;
    font-weight: 800;
    color: var(--army-gold);
    letter-spacing: 2px;
    line-height: 1.2;
}
.nav-brand-sub {
    font-size: .6rem;
    color: rgba(232,237,242,.4);
    letter-spacing: .5px;
}

/* Nav links */
#mainNavbar .navbar-nav .nav-link {
    color: rgba(232,237,242,.75) !important;
    padding: .4rem .85rem;
    border-radius: 7px;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
#mainNavbar .navbar-nav .nav-link:hover {
    color: var(--army-gold) !important;
    background: rgba(212,160,23,.1);
}
#mainNavbar .navbar-nav .nav-link.active {
    color: var(--army-gold) !important;
    background: rgba(212,160,23,.12);
    border: 1px solid rgba(212,160,23,.25);
}

/* User info */
.nav-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-role-badge {
    font-size: .65rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: .5px;
}
.badge-admin   { background: rgba(212,160,23,.2); color: var(--army-gold);  border: 1px solid rgba(212,160,23,.4); }
.badge-master  { background: rgba(45,106,79,.3);  color: #6ee7b7;            border: 1px solid rgba(45,106,79,.5); }
.badge-viewer  { background: rgba(107,114,128,.2); color: #9ca3af;           border: 1px solid rgba(107,114,128,.3); }
.nav-username  { font-size: .78rem; color: rgba(232,237,242,.7); }
.btn-logout {
    background: rgba(139,26,26,.2);
    border: 1px solid rgba(200,30,30,.4);
    color: #f87171;
    font-size: .75rem;
    padding: 3px 10px;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-logout:hover {
    background: rgba(139,26,26,.4);
    color: #fff;
    border-color: #c81e1e;
}

/* ══════════════════════════════════════════════════════════
   Page wrapper
   ══════════════════════════════════════════════════════════ */
.page-wrapper {
    padding: 24px 16px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════
   活動主視覺 Hero Banner
   ══════════════════════════════════════════════════════════ */
.hero-banner {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    min-height: 200px;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b4332 40%, #0d1b2a 100%);
    border: 1px solid rgba(212,160,23,.3);
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.hero-banner .hero-bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(45,106,79,.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(212,160,23,.12) 0%, transparent 40%),
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.01) 35px, rgba(255,255,255,.01) 70px);
}
.hero-banner .hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(212,160,23,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212,160,23,.04) 1px, transparent 1px);
    background-size: 30px 30px;
}
.hero-banner .hero-content {
    position: relative;
    z-index: 2;
    padding: 32px 36px;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.hero-emblem-large {
    width: 90px; height: 90px;
    background: linear-gradient(135deg, #1b4332, #2d6a4f);
    border: 2px solid rgba(212,160,23,.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    flex-shrink: 0;
    box-shadow: 0 0 30px rgba(212,160,23,.3);
    animation: heroGlow 4s ease-in-out infinite;
}
@keyframes heroGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(212,160,23,.3); }
    50%       { box-shadow: 0 0 50px rgba(212,160,23,.5); }
}
.hero-text { flex: 1; min-width: 200px; }
.hero-event-code {
    font-size: .7rem;
    color: rgba(232,237,242,.5);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--army-gold);
    letter-spacing: 4px;
    line-height: 1.1;
    text-shadow: 0 0 30px rgba(212,160,23,.4);
    margin: 0 0 6px;
}
.hero-subtitle {
    font-size: .9rem;
    color: rgba(232,237,242,.65);
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.hero-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.hero-meta-item {
    font-size: .78rem;
    color: rgba(232,237,242,.6);
    display: flex;
    align-items: center;
    gap: 4px;
}
.hero-meta-item strong { color: rgba(232,237,242,.9); }

/* 倒數計時大顯示 */
.hero-countdown {
    text-align: center;
    padding: 20px 28px;
    background: rgba(0,0,0,.3);
    border: 1px solid rgba(212,160,23,.25);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}
.hero-cd-label {
    font-size: .65rem;
    color: rgba(232,237,242,.5);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.hero-cd-blocks {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}
.hero-cd-block {
    text-align: center;
    background: rgba(13,27,42,.6);
    border: 1px solid rgba(212,160,23,.25);
    border-radius: 8px;
    padding: 6px 12px;
    min-width: 52px;
}
.hero-cd-block .num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--army-gold);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.hero-cd-block .unit {
    font-size: .6rem;
    color: rgba(212,160,23,.6);
    letter-spacing: 1px;
}
.hero-cd-sep {
    font-size: 1.6rem;
    font-weight: 700;
    color: rgba(212,160,23,.5);
    line-height: 1;
    margin-bottom: 8px;
}
.hero-cd-date {
    font-size: .65rem;
    color: rgba(232,237,242,.4);
    margin-top: 8px;
    letter-spacing: .5px;
}

/* ══════════════════════════════════════════════════════════
   Cards
   ══════════════════════════════════════════════════════════ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--card-bg);
}
.card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: .8rem 1.2rem;
    font-weight: 600;
    font-size: .9rem;
}

/* ══════════════════════════════════════════════════════════
   Stat cards
   ══════════════════════════════════════════════════════════ */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: rgba(26,86,219,.2);
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 2px; }
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }

/* ══════════════════════════════════════════════════════════
   Progress bars
   ══════════════════════════════════════════════════════════ */
.progress {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: visible;
}
.progress-bar {
    border-radius: 999px;
    position: relative;
    transition: width .6s ease;
}
.progress-sm { height: 6px; }
.progress-lg { height: 14px; }

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.progress-label span  { font-size: .8rem; color: var(--text-muted); }
.progress-label strong { font-size: .85rem; font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   Tables
   ══════════════════════════════════════════════════════════ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.table { margin: 0; font-size: 13px; }
.table thead th {
    background: #f1f5f9;
    color: var(--text-muted);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    padding: 10px 14px;
}
.table tbody td {
    padding: 10px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ══════════════════════════════════════════════════════════
   關卡流程圖 (Station Timeline)
   ══════════════════════════════════════════════════════════ */
.station-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.station-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: default;
}
.station-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(45,106,79,.4);
}
.station-card.status-complete {
    border-color: rgba(5,122,85,.4);
    background: linear-gradient(135deg, #f0fdf4, #fff);
}
.station-card.status-inprog {
    border-color: rgba(26,86,219,.3);
    background: linear-gradient(135deg, #eff6ff, #fff);
}
.station-card.status-delay {
    border-color: rgba(200,30,30,.3);
    background: linear-gradient(135deg, #fff5f5, #fff);
}
.station-card.status-pending {
    border-color: var(--border);
    background: #fff;
}
.station-num {
    font-size: .65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.station-name {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.3;
}
.station-img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}
.station-img-placeholder {
    width: 100%;
    height: 90px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #cbd5e1;
    border: 1px solid var(--border);
}
.station-owner {
    font-size: .72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}
.station-corner-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* 流程圖時間線 */
.timeline-view {
    position: relative;
    padding-left: 40px;
}
.timeline-view::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--army-green), rgba(45,106,79,.1));
}
.timeline-item {
    position: relative;
    margin-bottom: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: var(--transition);
}
.timeline-item:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(45,106,79,.3);
}
.timeline-dot {
    position: absolute;
    left: -30px; top: 14px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--army-green);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--army-green);
}
.timeline-dot.complete { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-dot.inprog   { background: var(--primary); box-shadow: 0 0 0 2px var(--primary); animation: pulse 2s infinite; }
.timeline-dot.delay    { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger); }
.timeline-dot.pending  { background: #cbd5e1; box-shadow: 0 0 0 2px #cbd5e1; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--primary); }
    50%       { box-shadow: 0 0 0 5px rgba(26,86,219,.3); }
}

/* ══════════════════════════════════════════════════════════
   Badges
   ══════════════════════════════════════════════════════════ */
.badge {
    font-size: .72rem;
    padding: .3em .65em;
    border-radius: 6px;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   Buttons
   ══════════════════════════════════════════════════════════ */
.btn { border-radius: 7px; font-size: 13px; font-weight: 500; transition: var(--transition); }
.btn-sm { font-size: 12px; padding: 4px 10px; }
.btn-group-action .btn { margin: 0 1px; }

/* ══════════════════════════════════════════════════════════
   Page header
   ══════════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-title .icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ══════════════════════════════════════════════════════════
   Forms
   ══════════════════════════════════════════════════════════ */
.form-label { font-weight: 500; font-size: .875rem; margin-bottom: 4px; }
.form-control, .form-select {
    font-size: 13px;
    border-radius: 7px;
    border-color: #cbd5e1;
    padding: .45rem .75rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.required-star { color: var(--danger); margin-left: 2px; }

/* 圖片上傳區 */
.img-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: #fafbfc;
}
.img-upload-zone:hover, .img-upload-zone.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
}
.img-upload-zone .upload-icon { font-size: 2rem; color: #94a3b8; margin-bottom: 8px; }
.img-upload-zone .upload-hint { font-size: .78rem; color: var(--text-muted); }
.img-preview {
    max-width: 100%; max-height: 200px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-top: 10px;
    display: none;
    object-fit: cover;
}

/* ══════════════════════════════════════════════════════════
   Alerts
   ══════════════════════════════════════════════════════════ */
.alert { border-radius: var(--radius); font-size: 13px; border: none; }

/* ══════════════════════════════════════════════════════════
   Item card
   ══════════════════════════════════════════════════════════ */
.item-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.item-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════════
   Members tags
   ══════════════════════════════════════════════════════════ */
.member-tag {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .75rem;
    margin: 2px;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   Footer
   ══════════════════════════════════════════════════════════ */
.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: .78rem;
    margin-top: 30px;
    border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════
   Misc
   ══════════════════════════════════════════════════════════ */
.section-divider { height: 1px; background: var(--border); margin: 20px 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.breadcrumb { font-size: .8rem; background: transparent; padding: 0; margin-bottom: 4px; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted); }
.indicator-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.indicator-row:last-child { border-bottom: none; }
.member-check-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 10px;
    background: #fafafa;
}
.member-check-list .form-check { padding: 6px 8px; border-radius: 5px; transition: background .15s; }
.member-check-list .form-check:hover { background: #eff6ff; }
.member-check-list .form-check-label { cursor: pointer; font-size: 13px; }

/* ══════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root { --navbar-h: 96px; }
    .page-wrapper { padding: 16px 8px; }
    .stat-value { font-size: 1.5rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-title { font-size: 1.1rem; }
    .hero-content { padding: 20px 16px; gap: 16px; }
    .hero-title { font-size: 1.6rem; }
    .hero-countdown { padding: 14px 16px; }
    .hero-cd-block .num { font-size: 1.4rem; }
    .station-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .btn-sm { font-size: 11px; }
    .btn-group-action { display: flex; flex-direction: column; gap: 3px; }
}
