/* ================================================================
   app.css — 全局基础样式
   烽熵科技统一认证中心：品牌色、重置、通用组件
   所有页面（认证/个人中心/管理后台）共享此文件
   ================================================================ */

/* ---------- 品牌变量 ---------- */
:root {
    --brand:      #003ba2;
    --brand-dark: #002d7a;
    --brand-2:    #1f56b5;
    --brand-soft: #eaf0fb;
    --accent:     #81b14a;
    --accent-dark:#6b9a3a;
    --accent-soft:#f1f8ea;
    --ink:        #222222;
    --text:       #333333;
    --text-2:     #5f6368;
    --text-3:     #8a8f99;
    --bg:         #eef1f5;
    --card:       #ffffff;
    --line:       #e3e5ea;
    --line-2:     #eef0f3;
    --ok:         #4d8b1f;
    --ok-bg:      #f1f8ea;
    --ok-line:    #d4e7bd;
    --warn:       #b06a00;
    --warn-bg:    #fff6e6;
    --danger:     #c0392b;
    --danger-bg:  #fdeded;
    --danger-line:#f1c8c2;
    --radius:     5px;
    --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Tahoma,
            "Lucida Grande", Helvetica, Arial, sans-serif;
    --mono: "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
}

/* ---------- 重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-width: 320px; background: var(--bg); }
body {
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid rgba(0, 59, 162, .35);
    outline-offset: 2px;
}
svg { display: block; }

/* ---------- 顶栏（认证页 + 个人中心共用） ---------- */
.site-header {
    background: var(--card);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 55%, var(--accent) 100%) 1;
    box-shadow: 0 1px 4px rgba(16, 24, 40, .05);
}
.site-header.sticky { position: sticky; z-index: 20; top: 0; }
.site-header-inner {
    width: 100%; max-width: 1200px; margin: 0 auto;
    height: 60px; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo img { height: 32px; width: auto; display: block; }
.brand-tag {
    padding-left: 12px; color: var(--text-3); font-size: 13px; font-weight: 400;
    border-left: 1px solid var(--line);
}

/* ---------- 提示条 ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 9px;
    margin-bottom: 16px; padding: 11px 13px;
    border: 1px solid; border-radius: var(--radius);
    font-size: 13px; line-height: 1.5;
}
.alert svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.alert-success { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.alert-error   { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.card + .card { margin-top: 18px; }
.card-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 18px 22px 14px; border-bottom: 1px solid var(--line);
}
.card-head h2 { color: var(--ink); font-size: 15px; }
.card-head h3 { color: var(--ink); font-size: 15px; margin-bottom: 0; }
.card-head p { margin-top: 4px; color: var(--text-3); font-size: 12px; }
.card-tag {
    padding: 4px 9px; color: var(--brand); background: var(--brand-soft);
    border-radius: var(--radius); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.card-body { padding: 18px 22px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    padding: 11px 18px; color: var(--text-3); background: #fafbfc;
    font-size: 11px; font-weight: 600; text-align: left;
    text-transform: uppercase; letter-spacing: .03em;
}
td {
    padding: 14px 18px; color: var(--text-2);
    border-top: 1px solid var(--line); vertical-align: middle;
}
tr:last-child td { border-bottom: 0; }

/* ---------- 按钮 ---------- */
.btn {
    min-height: 44px; width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background .15s, transform .06s;
}
.btn svg { width: 16px; height: 16px; transition: transform .15s; }
.btn:hover svg { transform: translateX(2px); }
.btn:active { transform: translateY(1px); }
.btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; color: #fff; background: var(--brand);
    border: none; border-radius: var(--radius);
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background .15s;
}
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; color: var(--text-2); background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius);
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: all .15s;
}
.btn-secondary:hover { color: var(--brand); border-color: var(--brand-soft); }
.btn-sm {
    padding: 6px 13px; border-radius: var(--radius); border: 1px solid transparent;
    cursor: pointer; font-size: 12.5px; font-weight: 500; text-decoration: none;
    display: inline-block; transition: all .15s;
}
.btn-sm.btn-primary { background: var(--brand); color: #fff; }
.btn-sm.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-sm.btn-danger { background: #fff; color: var(--danger); border-color: #e8b4ae; }
.btn-sm.btn-danger:hover { background: var(--danger-bg); }
.btn-sm.btn-default { background: #fff; color: var(--text-2); border-color: var(--line); }
.btn-sm.btn-default:hover { border-color: #c2c6cf; color: var(--text); }

/* ---------- 徽章 ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px; border-radius: 4px;
    font-size: 11px; font-weight: 600;
}
.badge-on { background: var(--accent-soft); color: var(--accent-dark); }
.badge-off { background: var(--danger-bg); color: var(--danger); }

/* ---------- 指标卡片 ---------- */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.metric {
    display: flex; align-items: center; gap: 13px;
    padding: 16px 18px; background: var(--card);
    border: 1px solid var(--line); border-radius: 8px;
}
.metric-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
    color: var(--brand); background: var(--brand-soft); border-radius: var(--radius);
}
.metric-icon.success { color: var(--accent-dark); background: var(--accent-soft); }
.metric-icon.warning { color: var(--warn); background: var(--warn-bg); }
.metric-icon svg { width: 19px; height: 19px; }
.metric small, .metric strong { display: block; }
.metric small { color: var(--text-3); font-size: 11px; }
.metric strong { margin-top: 2px; color: var(--ink); font-size: 14px; }

/* ---------- 详情行 ---------- */
.details { padding: 6px 22px 10px; }
.detail-row {
    display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 14px;
    padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.detail-row:last-child { border-bottom: 0; }
.detail-label { color: var(--text-3); }
.detail-value { min-width: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.detail-value.mono { font-family: var(--mono); font-size: 12.5px; }
.verify {
    display: inline-flex; align-items: center; margin-left: 7px;
    padding: 2px 7px; color: var(--accent-dark); background: var(--accent-soft);
    border-radius: 4px; font-size: 10px; font-weight: 600; vertical-align: middle;
}
.verify.unverified { color: var(--warn); background: var(--warn-bg); }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; margin-bottom: 6px;
    color: var(--text); font-size: 13px; font-weight: 600;
}
.form-group label .optional { color: var(--text-3); font-weight: 400; font-size: 12px; }
.form-input {
    width: 100%; max-width: 420px; padding: 9px 12px;
    color: var(--text); background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius);
    font-size: 13.5px; transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,59,162,.08); }
.form-input:read-only { background: var(--bg); color: var(--text-2); cursor: not-allowed; }
.form-hint { margin-top: 5px; color: var(--text-3); font-size: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 6px; }
.form-tip { margin-top: 6px; color: var(--text-3); font-size: 12px; line-height: 1.6; }
.form-tip code {
    padding: 1px 5px; background: #f0f1f3; border-radius: 3px;
    font-family: var(--mono); font-size: 11.5px; color: var(--brand);
}
.form-tip b { color: var(--text-2); font-weight: 600; }

/* ---------- 设备行 ---------- */
.device { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.device-icon {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
    color: var(--brand); background: var(--brand-soft); border-radius: var(--radius);
}
.device-icon svg { width: 16px; height: 16px; }
.online { color: var(--text-3); }
.btn-kick {
    padding: 6px 11px; color: var(--danger); background: #fff;
    border: 1px solid #e8b4ae; border-radius: var(--radius);
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: background .15s;
}
.btn-kick:hover { background: var(--danger-bg); }

/* ---------- 空状态 ---------- */
.empty-state {
    padding: 36px 22px; color: var(--text-3);
    text-align: center; font-size: 13px;
}

/* ---------- 页脚 ---------- */
.page-footer {
    margin-top: 32px; padding: 16px 0;
    color: var(--text-3); text-align: center; font-size: 11px;
    border-top: 1px solid var(--line-2);
}

/* ---------- 分页 ---------- */
.pager { margin-top: 16px; font-size: 13px; color: var(--text-3); }
.pager a { color: var(--brand); margin: 0 6px; }

/* ---------- 基础响应式 ---------- */
@media (max-width: 860px) {
    .metrics { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .site-header-inner { padding: 0 16px; }
    .brand-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
