* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif; margin: 0; background: #f6f7fb; color: #222; }
.container { max-width: 1100px; margin: 32px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.06); margin-bottom: 18px; }
h1 { margin: 0 0 12px; font-size: 24px; }
h2 { margin: 0 0 12px; font-size: 18px; }
label { display: block; margin-bottom: 6px; }
input, select, textarea { width: 100%; padding: 10px 12px; margin-bottom: 10px; border: 1px solid #e5e7eb; border-radius: 10px; }
button { padding: 10px 14px; border: none; border-radius: 12px; background: #2563eb; color: #fff; cursor: pointer; }
button:hover { opacity: .9; }
.muted { color: #6b7280; font-size: 12px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eee; white-space: nowrap; }
.row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.pager { display: flex; align-items: center; gap: 10px; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.dot.online { background:#10b981; }   /* 绿 */
.dot.offline { background:#9ca3af; }  /* 灰 */
.link-like:hover {
    opacity: 0.8;
}

/* 点击文字样式 */
.link-like {
    cursor: pointer;
    text-decoration: underline;
}

/* 到期状态颜色 */
.expire-active {   /* 正在使用：绿色 */
    color: #0a0;
    font-weight: bold;
}
.expire-expired {  /* 已过期：红色 */
    color: #d00;
    font-weight: bold;
}

/* 弹窗整体遮罩 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* 弹窗内容 */
.modal {
    background: #fff;
    padding: 16px 20px;
    border-radius: 6px;
    min-width: 260px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-size: 14px;
}

.modal-row {
    margin: 8px 0;
}

.modal-row label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-actions {
    margin-top: 12px;
    text-align: right;
}

.modal-actions button {
    margin-left: 6px;
}
/* =============== Dark Theme =============== */
body.dark {
    background-color: #181a1b;
    color: #e5e5e5;
}

/* 顶部栏 */
body.dark .topbar {
    background-color: #222;
    color: #e5e5e5;
}
body.dark .topbar button {
    background-color: #333;
    color: #eee;
    border: 1px solid #555;
}

/* 卡片区域 */
body.dark .card {
    background-color: #1f2122;
    border-color: #333;
    color: #eee;
}

/* 标题 */
body.dark h1,
body.dark h2,
body.dark h3 {
    color: #f1f1f1;
}

/* 输入框 / 文本框 */
body.dark input,
body.dark select,
body.dark textarea {
    background-color: #2a2d2e;
    color: #e5e5e5;
    border: 1px solid #444;
}
body.dark input::placeholder,
body.dark textarea::placeholder {
    color: #888;
}

/* 按钮 */
body.dark button {
    background-color: #2d4f85;
    color: #eee;
    border: none;
}
body.dark button:hover {
    background-color: #345c99;
}

/* 表格 */
body.dark table {
    background-color: #1f2122;
    color: #e5e5e5;
}
body.dark thead {
    background-color: #292b2c;
}
body.dark td,
body.dark th {
    border-color: #333;
}

/* 在线/离线点 */
body.dark .dot.online { background-color: #4caf50; }
body.dark .dot.offline { background-color: #777; }

/* 到期时间颜色：按你原来的红/绿逻辑 */
.expire-active { color: #4caf50 !important; }
.expire-expired { color: #ff5252 !important; }

/* 弹窗背景 */
body.dark .modal {
    background-color: #242526;
    color: #e5e5e5;
    border: 1px solid #444;
}
body.dark .modal-overlay {
    background: rgba(0,0,0,0.55);
}

/* 日期选择器(Chrome) 深色修复 */
body.dark input[type="date"],
body.dark input[type="time"] {
    color-scheme: dark;
}

.download-bar {
    margin: 12px 0 16px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #1f2933;      /* 深色背景，跟 dark 风格比较配 */
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    font-size: 14px;
}

.download-bar-left {
    display: flex;
    flex-direction: column;
}

.download-bar-title {
    font-weight: 600;
}

.download-bar-desc {
    font-size: 12px;
    color: #999;
}

.download-bar-actions button {
    white-space: nowrap;
}

/* =============== Login Page =============== */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background-color: #181a1b;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #1f2122;
    border-radius: 20px;
    padding: 36px 32px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 1px solid #2a2d2e;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 14px;
}

.login-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #f1f1f1;
}

.login-sub {
    font-size: 12px;
    color: #888;
    margin: 0;
    letter-spacing: 0.5px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form .input-group {
    display: flex;
    align-items: center;
    background: #2a2d2e;
    border: 1px solid #383b3c;
    border-radius: 12px;
    padding: 0 14px !important;
    transition: border-color 0.2s;
    margin-bottom: 0;
}

.login-form .input-group:focus-within {
    border-color: #4a7ecf;
}

.login-form .input-icon {
    font-size: 16px;
    margin-right: 10px;
    flex-shrink: 0;
    line-height: 1;
}

.login-form .input-group input {
    width: 100%;
    padding: 13px 0 !important;
    border: none !important;
    background: transparent !important;
    color: #e5e5e5;
    font-size: 15px;
    outline: none;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
}

.login-form .input-group input::placeholder {
    color: #666;
}

.login-btn {
    width: 100%;
    padding: 13px !important;
    border: none !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #2d5fa0, #1e3a6a) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 2px;
    letter-spacing: 2px;
}

.login-btn:hover {
    opacity: 0.9 !important;
    background: linear-gradient(135deg, #2d5fa0, #1e3a6a) !important;
}

.login-btn:active {
    transform: scale(0.98);
}

.login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    font-size: 13px;
    color: #777;
}

.login-footer a {
    color: #6a9de0;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-footer .dot-sep {
    color: #555;
}

.login-icp {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: #555;
}

.login-icp a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
}

.login-icp a:hover {
    color: #888;
}

.login-icp .dot-sep {
    margin: 0 6px;
    color: #444;
}

