* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
    transition: background-color 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
:root{
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --glass-blur: 16px;
    --glass-sat: 160%;
    --stroke-dark: rgba(255,255,255,0.14);
    --stroke-light: rgba(0,0,0,0.08);
    --shadow-dark: 0 14px 40px rgba(0,0,0,0.45);
    --shadow-light: 0 14px 45px rgba(10,20,40,0.12);
    --accent: #6aa9ff;
    --accent-2: #7c5cff;
    --text-strong-dark: rgba(255,255,255,0.92);
    --text-soft-dark: rgba(255,255,255,0.74);
    --text-strong-light: rgba(12,18,28,0.90);
    --text-soft-light: rgba(12,18,28,0.70);
}

body{
    min-height: 100vh;
    line-height: 1.55;
    padding: 22px 16px 40px;
}
.container {
    max-width: 1120px;
    margin: 0 auto;
}

body::before{
    content:"";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(1000px 520px at 12% 10%, rgba(124,92,255,0.34), transparent 60%),
        radial-gradient(820px 520px at 82% 20%, rgba(106,169,255,0.34), transparent 62%),
        radial-gradient(900px 560px at 60% 95%, rgba(53,214,207,0.18), transparent 58%),
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
}
body::after{
    content:"";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.9;
    pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 26px 26px;
    background-position: 0 0;
    mask-image: radial-gradient(circle at 50% 10%, rgba(0,0,0,0.9), rgba(0,0,0,0.1) 55%, transparent 75%);
}

body.dark {
    background-color: #0b1020;
    color: var(--text-strong-dark);
}
body.light {
    background-color: #f4f7ff;
    color: var(--text-strong-light);
}
.top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}
.theme-switch {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 0.2px;
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}
body.dark .theme-switch {
    background: rgba(255,255,255,0.06);
    color: var(--text-strong-dark);
    border-color: var(--stroke-dark);
    box-shadow: 0 10px 26px rgba(0,0,0,0.35);
}
body.light .theme-switch {
    background: rgba(255,255,255,0.70);
    color: var(--text-strong-light);
    border-color: rgba(255,255,255,0.65);
    box-shadow: 0 10px 26px rgba(10,20,40,0.08);
}
.theme-switch:hover{ transform: translateY(-1px); }
.theme-switch:active{ transform: translateY(0); }

.glass{
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}
body.dark .glass{
    background: rgba(255,255,255,0.06);
    border-color: var(--stroke-dark);
    box-shadow: var(--shadow-dark);
}
body.light .glass{
    background: rgba(255,255,255,0.68);
    border-color: rgba(255,255,255,0.60);
    box-shadow: var(--shadow-light);
}
.search-bar {
    padding: 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 22px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
body.dark .search-bar {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--stroke-dark);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    box-shadow: var(--shadow-dark);
}
body.light .search-bar {
    background: rgba(255,255,255,0.70);
    border: 1px solid rgba(255,255,255,0.60);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    box-shadow: var(--shadow-light);
}
.search-bar input {
    flex: 1;
    min-width: 180px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
}
body.dark .search-bar input {
    background: rgba(0,0,0,0.22);
    border-color: rgba(255,255,255,0.12);
    color: var(--text-strong-dark);
}
body.light .search-bar input {
    background: rgba(255,255,255,0.70);
    border-color: rgba(10,20,40,0.10);
    color: var(--text-strong-light);
}
.search-bar input:focus{
    border-color: rgba(106,169,255,0.55);
    box-shadow: 0 0 0 4px rgba(106,169,255,0.16);
}
.search-bar button {
    padding: 11px 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 12px 28px rgba(106,169,255,0.25);
}
.search-bar button:hover{ transform: translateY(-1px); }
.search-bar button:active{ transform: translateY(0); }

.course-card {
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}
body.dark .course-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--stroke-dark);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    box-shadow: var(--shadow-dark);
}
body.light .course-card {
    background: rgba(255,255,255,0.70);
    border: 1px solid rgba(255,255,255,0.60);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    box-shadow: var(--shadow-light);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
}
body.light .card-header {
    border-bottom-color: rgba(10,20,40,0.10);
}
.course-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--accent);
}
.status-tag {
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 14px;
    border: 1px solid rgba(255,255,255,0.16);
}
.status-tag--success { background: rgba(46,125,50,0.95); }
.status-tag--fail { background: rgba(211,47,47,0.95); }
.status-tag--running { background: rgba(33,150,243,0.95); }
.info-row {
    font-size: 16px;
    margin: 8px 0;
}
body.dark .info-row {
    color: var(--text-soft-dark);
}
body.light .info-row {
    color: var(--text-soft-light);
}
.progress-bar-container {
    width: 100%;
    height: 16px;
    background-color: rgba(255,255,255,0.12);
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
}
body.light .progress-bar-container {
    background-color: rgba(10,20,40,0.10);
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(106,169,255,0.95), rgba(124,92,255,0.95));
    border-radius: 8px;
    text-align: right;
    line-height: 16px;
    padding-right: 8px;
    font-size: 14px;
    color: #fff;
}
.detail-row {
    font-size: 14px;
    margin: 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
body.dark .detail-row {
    color: rgba(255,255,255,0.62);
}
body.light .detail-row {
    color: rgba(12,18,28,0.62);
}
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}
.btn {
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn-detail { background: linear-gradient(135deg, #6aa9ff, #377dff); }
.btn-sync { background: linear-gradient(135deg, #47d18c, #1ea94f); }
.btn-refill { background: linear-gradient(135deg, #ffb74d, #ff7b2f); }
.btn-pwd { background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06)); border-color: rgba(255,255,255,0.16); }
body.light .btn-pwd {
    background: linear-gradient(135deg, rgba(12,18,28,0.62), rgba(12,18,28,0.40));
    border-color: rgba(12,18,28,0.16);
}
.empty-tip {
    text-align: center;
    padding: 40px;
    font-size: 16px;
}
body.dark .empty-tip {
    color: rgba(255,255,255,0.55);
}
body.light .empty-tip {
    color: rgba(12,18,28,0.55);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.62);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 18px;
}
.modal-content {
    width: 90%;
    max-width: 1000px;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    backdrop-filter: blur(calc(var(--glass-blur) + 2px)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 2px)) saturate(var(--glass-sat));
}
body.dark .modal-content {
    background: rgba(255,255,255,0.08);
    border-color: var(--stroke-dark);
    color: var(--text-strong-dark);
    box-shadow: 0 18px 70px rgba(0,0,0,0.55);
}
body.light .modal-content{
    background: rgba(255,255,255,0.78);
    border-color: rgba(255,255,255,0.62);
    color: var(--text-strong-light);
    box-shadow: 0 18px 70px rgba(10,20,40,0.18);
}
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.14);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
body.dark .modal-header {
    border-bottom-color: rgba(255,255,255,0.14);
}
body.light .modal-header{
    border-bottom-color: rgba(10,20,40,0.10);
}
.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: rgba(255,255,255,0.72);
}
body.light .close-btn{ color: rgba(12,18,28,0.55); }
.modal-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.14);
    padding: 0 20px;
}
body.dark .modal-tabs {
    border-bottom-color: rgba(255,255,255,0.14);
}
body.light .modal-tabs{
    border-bottom-color: rgba(10,20,40,0.10);
}
.tab-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.72);
    font-size: 16px;
}
body.dark .tab-item {
    color: rgba(255,255,255,0.72);
}
body.light .tab-item{
    color: rgba(12,18,28,0.62);
}
.tab-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: bold;
}
.tab-content {
    padding: 20px;
    max-height: 65vh;
    overflow-y: auto;
}
.pwd-modal-content{
    width: 92%;
    max-width: 760px;
}
.pwd-form{
    padding: 18px 20px 20px;
}
.pwd-row{
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.pwd-row label{
    font-size: 20px;
    font-weight: 600;
}
.pwd-row input{
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    outline: none;
    font-size: 16px;
}
body.dark .pwd-row input{
    background: rgba(0,0,0,0.22);
    border-color: rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.92);
}
body.light .pwd-row input{
    background: rgba(255,255,255,0.72);
    border-color: rgba(10,20,40,0.14);
    color: rgba(12,18,28,0.9);
}
.pwd-row input:focus{
    border-color: rgba(106,169,255,0.58);
    box-shadow: 0 0 0 4px rgba(106,169,255,0.16);
}
.pwd-actions{
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}
.pwd-btn{
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
}
.pwd-btn-primary{
    color: #fff;
    background: linear-gradient(135deg, #6aa9ff, #7c5cff);
}
.pwd-btn-secondary{
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.88);
    border-color: rgba(255,255,255,0.16);
}
body.light .pwd-btn-secondary{
    background: rgba(10,20,40,0.06);
    color: rgba(12,18,28,0.85);
    border-color: rgba(10,20,40,0.14);
}
.info-table { width:100%; border-collapse:collapse; }
.info-table th, .info-table td { padding:12px 15px; border:1px solid rgba(255,255,255,0.12); text-align:left; }
body.dark .info-table th, body.dark .info-table td {
    border-color: rgba(255,255,255,0.12);
}
body.light .info-table th, body.light .info-table td{ border-color: rgba(10,20,40,0.10); }
.info-table th { background: rgba(255,255,255,0.10); font-weight:bold; }
body.dark .info-table th {
    background: rgba(0,0,0,0.18);
}
body.light .info-table th{
    background: rgba(10,20,40,0.04);
}
.type-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
}
.type-sync { background: rgba(71,209,140,0.18); color: rgba(71,209,140,0.95); border: 1px solid rgba(71,209,140,0.30); }
.type-submit { background: rgba(106,169,255,0.18); color: rgba(106,169,255,0.95); border: 1px solid rgba(106,169,255,0.30); }
body.dark .type-sync {
    background: rgba(71,209,140,0.22);
    color: rgba(255,255,255,0.92);
    border-color: rgba(71,209,140,0.28);
}
body.dark .type-submit {
    background: rgba(106,169,255,0.22);
    color: rgba(255,255,255,0.92);
    border-color: rgba(106,169,255,0.28);
}
.status-tag-success {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(71,209,140,0.18);
    color: rgba(71,209,140,0.95);
    border: 1px solid rgba(71,209,140,0.30);
    font-size: 14px;
    font-weight: 500;
}
body.dark .status-tag-success {
    background: rgba(71,209,140,0.22);
    color: rgba(255,255,255,0.92);
    border-color: rgba(71,209,140,0.28);
}
.status-tag-fail {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(244,67,54,0.18);
    color: rgba(244,67,54,0.95);
    border: 1px solid rgba(244,67,54,0.32);
    font-size: 14px;
    font-weight: 500;
}
body.dark .status-tag-fail {
    background: rgba(244,67,54,0.24);
    color: rgba(255,255,255,0.92);
    border-color: rgba(244,67,54,0.34);
}
.content-cell {
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    cursor: pointer;
}
.content-cell:hover::after {
    display: none;
}
body.light .content-cell:hover::after {
    background: rgba(255,255,255,0.88);
    color: rgba(12,18,28,0.86);
    border: 1px solid rgba(10,20,40,0.10);
}
.log-table {
    width: 100%;
    border-collapse: collapse;
}
.log-table th, .log-table td {
    padding: 12px 15px;
    border: 1px solid rgba(255,255,255,0.12);
    text-align: left;
}
body.dark .log-table th, body.dark .log-table td {
    border-color: rgba(255,255,255,0.12);
}
body.light .log-table th, body.light .log-table td{
    border-color: rgba(10,20,40,0.10);
}
.log-table th {
    background: rgba(255,255,255,0.10);
    font-weight: bold;
    font-size: 15px;
}
body.dark .log-table th {
    background: rgba(0,0,0,0.18);
}
body.light .log-table th{
    background: rgba(10,20,40,0.04);
}
.stream-log {
    background: rgba(255,255,255,0.10);
    padding:15px;
    font-family: monospace;
    max-height:500px;
    overflow-y:auto;
    white-space:pre-wrap;
    line-height: 1.6;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
}
body.dark .stream-log {
    background: rgba(0,0,0,0.20);
    color: rgba(255,255,255,0.92);
    border-color: rgba(255,255,255,0.12);
}
body.light .stream-log{
    background: rgba(255,255,255,0.70);
    color: rgba(12,18,28,0.86);
    border-color: rgba(10,20,40,0.10);
}
.tooltip {
    position: fixed;
    background: rgba(0,0,0,0.62);
    color: rgba(255,255,255,0.92);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    max-width: 720px;
    z-index: 9999;
    display: none;
    box-shadow: 0 2px 8 rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    pointer-events: none;
    word-break: break-word;
}
body.light .tooltip {
    background: rgba(255,255,255,0.90);
    color: rgba(12,18,28,0.86);
    border: 1px solid rgba(10,20,40,0.10);
}

@media (max-width: 720px) {
    body { padding: 14px 12px 26px; }
    .top-bar { margin-bottom: 10px; }
    .search-bar { padding: 14px; gap: 10px; }
    .search-bar input { min-width: 0; width: 100%; flex: 1 1 100%; }
    .search-bar button { width: 100%; flex: 1 1 100%; }

    .course-card { padding: 16px; }
    .course-title { font-size: 18px; }
    .info-row { font-size: 14px; }
    .detail-row { font-size: 13px; }

    .btn-group { gap: 8px; }
    .btn { flex: 1 1 calc(50% - 8px); justify-content: center; }

    .modal { padding: 10px; }
    .modal-content { width: 100%; border-radius: 14px; }
    .modal-header { padding: 10px 12px; }
    .modal-tabs { padding: 0 10px; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .tab-item { padding: 9px 10px; font-size: 14px; flex: 0 0 auto; }
    .tab-content { padding: 10px; max-height: 72vh; }
    .pwd-modal-content { max-width: 100%; }
    .pwd-form { padding: 12px; }
    .pwd-row { grid-template-columns: 70px 1fr; gap: 8px; margin-bottom: 10px; }
    .pwd-row label { font-size: 16px; }
    .pwd-row input { font-size: 14px; padding: 10px 12px; }
    .pwd-btn { padding: 9px 12px; font-size: 13px; }

    #tabContent .info-table {
        display: table;
        table-layout: fixed;
        width: 100%;
    }
    #tabContent .info-table th {
        width: 5.8em;
        max-width: 5.8em;
        white-space: nowrap;
        vertical-align: top;
        box-sizing: border-box;
    }
    #tabContent .info-table td {
        word-break: break-word;
        overflow-wrap: anywhere;
        vertical-align: top;
    }
    #tabContent .info-table tr.info-row-progress td.info-cell-progress {
        white-space: normal;
    }

    .log-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .log-table th, .log-table td { padding: 6px 8px; font-size: 12px; }
    .log-table th { font-size: 12px; }

    .content-cell { max-width: 180px; }
    .tooltip {
        max-width: min(92vw, 720px);
        font-size: 12px;
        line-height: 1.35;
        padding: 6px 10px;
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.dark .search-bar,
    body.dark .course-card,
    body.dark .modal-content,
    body.dark .theme-switch{
        background: rgba(20,25,40,0.92);
    }
    body.light .search-bar,
    body.light .course-card,
    body.light .modal-content,
    body.light .theme-switch{
        background: rgba(255,255,255,0.96);
    }
}