/* XC-Time 深色 + 青绿风格（VEILFLOW 参考） */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
    background: #0d1117;
    color: #e6edf3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* ---------- 应用布局（用户中心 / 管理后台）：正常页面流，顶部导航 + 全宽内容 ---------- */

.app-body {
    display: block;
    justify-content: initial;
    align-items: initial;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0d1117;
    border-bottom: 1px solid #21262d;
    padding: 0 28px;
    height: 56px;
}

.app-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #22d3b0;
}

.app-nav a {
    color: #8b949e;
    text-decoration: none;
    margin-left: 20px;
    font-size: 13px;
    transition: color 0.2s;
}

.app-nav a:hover { color: #22d3b0; }

.app-nav a.active {
    color: #22d3b0;
    font-weight: 600;
}

.page.app-page {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 28px 8px;
    box-sizing: border-box;
}

.app-title {
    font-size: 22px;
    font-weight: 600;
    color: #e6edf3;
    margin-bottom: 4px;
}

.app-sub {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 28px;
}

/* ---------- 后台面板与表单（标准管理界面风格） ---------- */

.panel {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.panel-title {
    font-size: 15px;
    color: #22d3b0;
    font-weight: 600;
    margin: 26px 0 12px;
}

.panel-title:first-child { margin-top: 0; }

/* panel 标题行：左标题 + 右侧工具（筛选/复制） */
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 26px 0 12px;
}

.panel-head:first-child { margin-top: 0; }

.panel-head .panel-title { margin: 0; }

.panel-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-label { font-size: 12px; color: #8b949e; white-space: nowrap; }

.select.sm { width: 112px; padding: 6px 8px; font-size: 13px; }

.btn-copy {
    background: rgba(34, 211, 176, 0.1);
    border: 1px solid rgba(34, 211, 176, 0.45);
    color: #22d3b0;
}

.btn-copy:hover { background: rgba(34, 211, 176, 0.22); color: #4ee7c6; }

.row-copy {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex: none;
}

.row-copy:hover { border-color: #22d3b0; color: #22d3b0; }

.key-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 表单：label 在上、控件在下 */
.form-grid {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.f-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.f-item label {
    font-size: 12px;
    color: #8b949e;
}

.f-item .mini-input,
.f-item .select {
    width: 150px;
    padding: 8px 10px;
}

.f-item .mini-input.sm { width: 100px; }

.f-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page { width: 100%; max-width: 420px; padding: 24px; }

.brand {
    text-align: center;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #22d3b0;
    margin-bottom: 8px;
    text-shadow: 0 0 24px rgba(34, 211, 176, 0.25);
}

.subtitle {
    text-align: center;
    color: #8b949e;
    font-size: 13px;
    margin-bottom: 32px;
}

.card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 12px;
    padding: 28px 24px;
}

.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 11px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e6edf3;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.field input:focus { border-color: #22d3b0; }

.btn {
    width: 100%;
    padding: 12px;
    background: #22d3b0;
    color: #04120f;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover { background: #2ee0bd; }

.link-line {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: #8b949e;
}

.link-line a { color: #22d3b0; text-decoration: none; }
.link-line a:hover { text-decoration: underline; }

.alert {
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.35);
    color: #f85149;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(34, 211, 176, 0.1);
    border: 1px solid rgba(34, 211, 176, 0.35);
    color: #22d3b0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #21262d;
    font-size: 14px;
}

.info-row .k { color: #8b949e; }
.info-row .v { color: #e6edf3; font-weight: 600; }
.info-row .v.ok { color: #22d3b0; }
.info-row .v.bad { color: #f85149; }

.section-title {
    font-size: 15px;
    color: #22d3b0;
    margin: 22px 0 12px;
    font-weight: 600;
}

.download-link {
    display: block;
    padding: 12px 14px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #22d3b0;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.download-link:hover { border-color: #22d3b0; }

.footer {
    margin-top: 28px;
    text-align: center;
    color: #484f58;
    font-size: 12px;
}

/* ---------- 管理后台 ---------- */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 900px;
}

.admin-table th, .admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #21262d;
    text-align: left;
    vertical-align: middle;
}

.admin-table th { color: #8b949e; font-weight: 600; white-space: nowrap; }
.admin-table td { color: #e6edf3; }

.tag-unused { color: #22d3b0; }
.tag-bound  { color: #f0883e; }
.tag-admin  { color: #22d3b0; font-weight: 600; }
.tag-user   { color: #8b949e; }

.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: 0.5px; }

.key-code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    color: #e6edf3;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 4px 0;
    display: inline-block;
    letter-spacing: 1px;
    user-select: all;
}

.btn-sm {
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid #30363d;
    color: #e6edf3;
}

.btn-ghost:hover { border-color: #22d3b0; color: #22d3b0; background: transparent; }

.btn-danger {
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.4);
    color: #f85149;
}

.btn-danger:hover { background: rgba(248, 81, 73, 0.25); color: #f85149; }

.mini-input {
    padding: 6px 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 13px;
    outline: none;
}

.mini-input:focus { border-color: #22d3b0; }

.select {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.select:focus { border-color: #22d3b0; }

.form-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 6px 0;
}

.op-block { display: flex; flex-direction: column; gap: 8px; min-width: 300px; }

.op-label {
    display: block;
    font-size: 11px;
    color: #8b949e;
    margin-bottom: 2px;
}

.op-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.op-form .mini-input { width: 150px; }

/* ---------- 管理后台：侧边栏 + 内容区 ---------- */

.admin-shell {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.admin-sidebar {
    width: 190px;
    flex: 0 0 190px;
    background: #11161c;
    border: 1px solid #21262d;
    border-radius: 10px;
    padding: 10px 0;
    position: sticky;
    top: 84px;
}

.side-item {
    display: block;
    padding: 11px 20px;
    color: #8b949e;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.side-item:hover { color: #e6edf3; background: #161b22; }

.side-item.active {
    color: #22d3b0;
    background: #161b22;
    border-left-color: #22d3b0;
    font-weight: 600;
}

.admin-content { flex: 1 1 auto; min-width: 0; }

/* 标签页（管理KEY：未使用/已使用） */

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.tab-link {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid #21262d;
    color: #8b949e;
    text-decoration: none;
    font-size: 13px;
    background: #161b22;
    transition: color 0.15s, border-color 0.15s;
}

.tab-link:hover { color: #e6edf3; }

.tab-link.active { color: #22d3b0; border-color: #22d3b0; }

/* 模态弹窗 */

.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-mask.show { display: flex; }

.modal {
    width: 440px;
    max-width: 92vw;
    max-height: 86vh;
    overflow-y: auto;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 12px;
    padding: 22px;
    box-sizing: border-box;
}

.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }

.modal-sub { font-size: 12px; color: #8b949e; margin-bottom: 16px; }

.modal .field { margin-bottom: 12px; }

.modal-close {
    float: right;
    background: none;
    border: none;
    color: #8b949e;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

.modal-close:hover { color: #e6edf3; }

/* 明文密码 / 旧格式 */

.pw-plain {
    font-family: Consolas, "Courier New", monospace;
    color: #e6edf3;
    letter-spacing: 0.5px;
}

.pw-legacy { color: #6e7681; font-size: 12px; }

/* 每日生成统计 */

.stat-total { font-size: 13px; color: #8b949e; }

.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; }

.link-user {
    color: #22d3b0;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px dashed #22d3b0;
}

.link-user:hover { color: #4ee7c6; }
