/* ==========================================================
   统一设计系统 · 浅色极简 + 品牌墨绿
   ----------------------------------------------------------
   只提供设计令牌与通用组件，不强行覆盖业务类名。
   页面通过 <link rel="stylesheet" href="css/ui-light.css"> 引入。
   ========================================================== */

:root {
    /* 品牌色 */
    --ui-brand-900: #0B3B26;
    --ui-brand-800: #0F5132;
    --ui-brand-700: #146B45;
    --ui-brand-600: #1B8A5A;
    --ui-brand-500: #22A06B;
    --ui-brand-200: #BFE3D0;
    --ui-brand-100: #E6F3EC;
    --ui-brand-050: #F2F9F5;

    /* 中性色 */
    --ui-canvas: #F4F7F5;
    --ui-surface: #FFFFFF;
    --ui-surface-2: #FAFCFA;
    --ui-ink: #102019;
    --ui-ink-2: #33463C;
    --ui-muted: #6F8178;
    --ui-line: #E3EAE5;
    --ui-line-strong: #D2DCD5;

    /* 语义色 */
    --ui-danger: #C0392B;
    --ui-danger-050: #FDF1EF;
    --ui-warn: #B7791F;
    --ui-warn-050: #FDF6E8;
    --ui-info: #2B6CB0;
    --ui-info-050: #EEF5FC;
    --ui-success: #1B8A5A;

    /* 形状与阴影 */
    --ui-radius-sm: 10px;
    --ui-radius: 16px;
    --ui-radius-lg: 22px;
    --ui-radius-pill: 999px;
    --ui-shadow-sm: 0 1px 2px rgba(15, 81, 50, .06), 0 1px 3px rgba(15, 81, 50, .04);
    --ui-shadow: 0 10px 30px -12px rgba(15, 81, 50, .18);
    --ui-shadow-lg: 0 24px 60px -24px rgba(15, 81, 50, .28);

    /* 字体 */
    --ui-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --ui-font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.ui-scope,
body.ui-page {
    font-family: var(--ui-font);
    color: var(--ui-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--ui-brand-200);
    color: var(--ui-brand-900);
}

/* ---------- 容器与卡片 ---------- */
.ui-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

.ui-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
}

.ui-card-pad {
    padding: 22px;
}

.ui-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ui-ink);
    letter-spacing: .2px;
}

.ui-card-sub {
    font-size: 12.5px;
    color: var(--ui-muted);
    line-height: 1.6;
}

.ui-divider {
    height: 1px;
    background: var(--ui-line);
    border: 0;
    margin: 16px 0;
}

/* ---------- 按钮 ---------- */
.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    border-radius: var(--ui-radius-pill);
    border: 1px solid transparent;
    font-family: var(--ui-font);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease, opacity .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.ui-btn:active { transform: scale(.975); }
.ui-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(27, 138, 90, .2); }
.ui-btn[disabled], .ui-btn.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ui-btn-primary {
    background: var(--ui-brand-800);
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(15, 81, 50, .6);
}
.ui-btn-primary:hover { background: var(--ui-brand-700); }

.ui-btn-soft {
    background: var(--ui-brand-050);
    border-color: var(--ui-brand-100);
    color: var(--ui-brand-800);
}
.ui-btn-soft:hover { background: var(--ui-brand-100); }

.ui-btn-outline {
    background: var(--ui-surface);
    border-color: var(--ui-line-strong);
    color: var(--ui-ink-2);
}
.ui-btn-outline:hover { border-color: var(--ui-brand-600); color: var(--ui-brand-800); }

.ui-btn-ghost {
    background: transparent;
    color: var(--ui-muted);
}
.ui-btn-ghost:hover { background: var(--ui-brand-050); color: var(--ui-brand-800); }

.ui-btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.ui-btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.ui-btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.ui-field { display: flex; flex-direction: column; gap: 7px; }
.ui-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ui-ink-2);
    letter-spacing: .2px;
}
.ui-input,
.ui-select,
.ui-textarea {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    border-radius: var(--ui-radius-sm);
    border: 1px solid var(--ui-line-strong);
    background: var(--ui-surface);
    color: var(--ui-ink);
    font-family: var(--ui-font);
    font-size: 14.5px;
    line-height: 1.4;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.ui-textarea { height: auto; min-height: 110px; padding: 13px 15px; resize: vertical; }
.ui-input::placeholder,
.ui-textarea::placeholder { color: #9AABA2; }
.ui-input:focus,
.ui-select:focus,
.ui-textarea:focus {
    outline: none;
    border-color: var(--ui-brand-600);
    box-shadow: 0 0 0 4px rgba(27, 138, 90, .14);
    background: #fff;
}
.ui-hint { font-size: 12px; color: var(--ui-muted); line-height: 1.55; }

/* ---------- 徽标 / 标签 ---------- */
.ui-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-brand-050);
    border: 1px solid var(--ui-brand-100);
    color: var(--ui-brand-800);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.ui-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-brand-100);
    color: var(--ui-brand-800);
    font-size: 11.5px;
    font-weight: 700;
}
.ui-badge-danger { background: var(--ui-danger-050); color: var(--ui-danger); }
.ui-badge-warn { background: var(--ui-warn-050); color: var(--ui-warn); }
.ui-badge-info { background: var(--ui-info-050); color: var(--ui-info); }

/* ---------- 数据展示 ---------- */
.ui-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ui-stat-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.6px;
    color: var(--ui-ink);
    font-variant-numeric: tabular-nums;
}
.ui-stat-label { font-size: 12px; color: var(--ui-muted); letter-spacing: .4px; }

.ui-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}
.ui-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--ui-muted);
    background: var(--ui-surface-2);
    border-bottom: 1px solid var(--ui-line);
    white-space: nowrap;
}
.ui-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--ui-line);
    color: var(--ui-ink-2);
    vertical-align: middle;
}
.ui-table tbody tr:last-child td { border-bottom: 0; }
.ui-table tbody tr:hover td { background: var(--ui-brand-050); }

/* ---------- 空状态 ---------- */
.ui-empty {
    padding: 46px 20px;
    text-align: center;
    color: var(--ui-muted);
    font-size: 13.5px;
    line-height: 1.7;
}
.ui-empty i { display: block; font-size: 34px; color: var(--ui-line-strong); margin-bottom: 10px; }

/* ---------- 遮罩 / 弹层 ---------- */
.ui-mask {
    position: fixed;
    inset: 0;
    background: rgba(9, 26, 18, .46);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
}
.ui-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(100%, 520px);
    background: var(--ui-surface);
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -20px 60px -30px rgba(9, 26, 18, .5);
    z-index: 9100;
    padding: 10px 20px 26px;
}
.ui-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--ui-line-strong);
    margin: 0 auto 14px;
}
.ui-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(calc(100vw - 40px), 420px);
    background: var(--ui-surface);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-lg);
    z-index: 9100;
    padding: 26px 22px 20px;
}

/* ---------- 通用工具 ---------- */
.ui-row { display: flex; align-items: center; }
.ui-between { display: flex; align-items: center; justify-content: space-between; }
.ui-gap-8 { gap: 8px; }
.ui-gap-12 { gap: 12px; }
.ui-gap-16 { gap: 16px; }
.ui-grow { flex: 1; min-width: 0; }
.ui-mono { font-family: var(--ui-font-mono); font-variant-numeric: tabular-nums; }
.ui-text-muted { color: var(--ui-muted); }
.ui-text-brand { color: var(--ui-brand-800); }
.ui-text-danger { color: var(--ui-danger); }
.ui-nowrap { white-space: nowrap; }
.ui-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 滚动条 ---------- */
.ui-scroll { scrollbar-width: thin; scrollbar-color: var(--ui-line-strong) transparent; }
.ui-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.ui-scroll::-webkit-scrollbar-thumb { background: var(--ui-line-strong); border-radius: 999px; }
.ui-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- 骨架屏 ---------- */
.ui-skeleton {
    background: linear-gradient(90deg, #EEF3EF 25%, #F6FAF7 37%, #EEF3EF 63%);
    background-size: 400% 100%;
    animation: uiSkeleton 1.4s ease infinite;
    border-radius: var(--ui-radius-sm);
}
@keyframes uiSkeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- 动效 ---------- */
@keyframes uiFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.ui-fade-up { animation: uiFadeUp .34s cubic-bezier(.22, .8, .3, 1) both; }

@media (prefers-reduced-motion: reduce) {
    .ui-btn, .ui-fade-up { transition: none !important; animation: none !important; }
}
