/*
 * 优时小车开放平台 · 商户控制台主题：深空灰 + 小车灵动绿（与运营后台代码互相独立）
 */
:root {
    --op-primary: #10b981;
    --op-primary-hover: #059669;
    --op-primary-soft: #ecfdf5;
    --op-neon: #00e599;
    --op-dark: #0f172a;
    --op-dark-surface: #1e293b;
    --op-silver: #cbd5e1;
    --op-success: #16a34a;
    --op-success-soft: #dcfce7;
    --op-warning: #d97706;
    --op-warning-soft: #fef3c7;
    --op-danger: #dc2626;
    --op-danger-soft: #fee2e2;
    --op-text: #0f172a;
    --op-text-2: #475569;
    --op-text-3: #94a3b8;
    --op-border: #e2e8f0;
    --op-bg: #f5f7fb;
    --op-surface: #ffffff;
    --op-radius: 12px;
    --op-radius-sm: 8px;
    --op-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .05);
    --op-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    --op-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

html, body { height: 100%; margin: 0; }
body, input, button, textarea, select {
    font-family: var(--op-font);
    color: var(--op-text);
    -webkit-font-smoothing: antialiased;
}
body { background: var(--op-bg); }
h1, h2, h3 { margin: 0; font-weight: 600; color: var(--op-text); }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin-bottom: 14px; }
.oc-boot, .oc-loading { padding: 64px; text-align: center; color: var(--op-text-3); }
.oc-muted { color: var(--op-text-3); font-size: 13px; }
.oc-hint { margin: 14px 0 0; color: var(--op-text-3); font-size: 12px; line-height: 1.6; }
.oc-mono { font-family: var(--op-mono); font-size: 13px; color: var(--op-text-2); word-break: break-all; }
.oc-small { font-size: 12px; }

/* ---------- layui 覆盖 ---------- */
.layui-btn { background: linear-gradient(135deg, #10b981 0%, #00c389 100%); box-shadow: 0 6px 16px rgba(16, 185, 129, .25); border-radius: var(--op-radius-sm); height: 38px; line-height: 38px; padding: 0 18px; }
.layui-btn:hover { opacity: 1; background: linear-gradient(135deg, #059669 0%, #10b981 100%); color: #fff; }
.layui-btn-sm { height: 30px; line-height: 30px; padding: 0 12px; font-size: 13px; }
.layui-btn-primary { background: var(--op-surface); color: var(--op-text-2); border-color: var(--op-border); box-shadow: none; }
.layui-btn-primary:hover { background: var(--op-surface); color: var(--op-primary); border-color: var(--op-primary); }
.layui-btn-danger { background: var(--op-danger); box-shadow: none; }
.layui-btn-danger:hover { background: #b91c1c; }
.layui-btn[disabled] { opacity: .55; cursor: not-allowed; }
.layui-input, .layui-textarea, .oc-select {
    border-radius: var(--op-radius-sm); border-color: var(--op-border); height: 38px; transition: border-color .15s, box-shadow .15s;
}
.layui-textarea { height: auto; min-height: 96px; font-family: var(--op-mono); font-size: 13px; }
.layui-input:focus, .layui-textarea:focus, .oc-select:focus {
    border-color: var(--op-primary) !important; box-shadow: 0 0 0 3px var(--op-primary-soft); outline: none;
}
.oc-select { padding: 0 10px; border: 1px solid var(--op-border); background: var(--op-surface); font-size: 14px; }
.layui-layer { border-radius: var(--op-radius) !important; overflow: hidden; }
.layui-layer-title { font-weight: 600; background: var(--op-surface); border-bottom: 1px solid var(--op-border); }
.layui-layer-btn .layui-layer-btn0 { background: var(--op-primary); border-color: var(--op-primary); border-radius: 6px; }
.layui-laypage .layui-laypage-curr .layui-laypage-em { background: var(--op-primary); }

/* ---------- 卡片 / 字段 ---------- */
.oc-card { background: var(--op-surface); border: 1px solid var(--op-border); border-radius: var(--op-radius); box-shadow: var(--op-shadow); }
.oc-field { display: block; margin-top: 18px; }
.oc-field > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--op-text-2); font-weight: 500; }
.oc-code-row { display: flex; gap: 10px; }
.oc-code-row .layui-input { flex: 1; }
.oc-code-row .layui-btn { flex: none; min-width: 112px; margin: 0; }
.oc-btn-block { display: block; width: 100%; margin: 24px 0 0 !important; }
.oc-link { border: 0; background: none; padding: 0; cursor: pointer; color: var(--op-primary); font-size: 13px; }
.oc-link:hover { color: var(--op-primary-hover); text-decoration: underline; }
.oc-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 20px; font-weight: 500; background: #f1f5f9; color: var(--op-text-2); }
.oc-badge-ok { background: var(--op-primary-soft); color: var(--op-primary-hover); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .25); }
.oc-badge-off { background: #f1f5f9; color: var(--op-text-3); }
.oc-badge-warn { background: var(--op-warning-soft); color: var(--op-warning); }
.oc-badge-bad { background: var(--op-danger-soft); color: var(--op-danger); }
.oc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.oc-chips span { padding: 2px 8px; border-radius: 6px; background: var(--op-primary-soft); color: var(--op-primary); font-size: 12px; font-family: var(--op-mono); }

/* ---------- 登录 ---------- */
.oc-login { display: flex; min-height: 100vh; background: var(--op-bg); }
.oc-login-brand {
    flex: 1.15; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 40px;
    padding: 44px 56px 32px; color: #e2e8f0;
    background:
        radial-gradient(ellipse at 80% 15%, rgba(0, 229, 153, .18), transparent 45%),
        linear-gradient(100deg, rgba(8, 13, 26, .96) 0%, rgba(11, 17, 32, .9) 42%, rgba(15, 23, 42, .62) 100%),
        url(car-scene.jpg) 62% center / cover no-repeat,
        #0b1120;
}
/* 科技微网格 */
.oc-login-brand::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(148, 163, 184, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 78%); mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 78%);
}
/* 车路协同光轨 */
.oc-login-brand::after {
    content: ""; position: absolute; left: -10%; right: -10%; bottom: 150px; height: 2px; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 153, .55), transparent); filter: blur(.5px); opacity: .6;
}
.oc-login-brand > * { position: relative; z-index: 1; }
.oc-brand-head { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: inherit; text-decoration: none; }
.oc-brand-head:hover { color: inherit; }
.oc-brand-head img { width: 34px; height: 34px; border-radius: 9px; }
.oc-login-brand .oc-brand-head { color: #f8fafc; font-size: 18px; }
.oc-login-brand .oc-brand-head img { width: 40px; height: 40px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.oc-brand-main { margin-top: auto; }
.oc-brand-main h2 { margin: 0 0 16px; color: #f8fafc; font-size: 34px; line-height: 1.35; font-weight: 700; letter-spacing: .5px; }
.oc-brand-main p { margin: 0 0 32px; max-width: 560px; color: #94a3b8; font-size: 15px; line-height: 1.8; }
.oc-feature-grid { display: grid; gap: 12px; max-width: 600px; }
.oc-feature {
    display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(30, 41, 59, .72), rgba(15, 23, 42, .5));
    border: 1px solid rgba(148, 163, 184, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: border-color .2s, box-shadow .2s;
}
.oc-feature:hover { border-color: rgba(0, 229, 153, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 0 24px rgba(0, 229, 153, .12); }
.oc-feature b { display: block; margin-bottom: 2px; color: #f1f5f9; font-size: 15px; font-weight: 600; }
.oc-feature span { color: #94a3b8; font-size: 13px; line-height: 1.6; }
.oc-feature-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(16, 185, 129, .12); border: 1px solid rgba(0, 229, 153, .3); }
.oc-feature-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--op-neon); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.oc-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 600px; border-radius: 14px; border: 1px solid rgba(148, 163, 184, .16); background: rgba(15, 23, 42, .55); overflow: hidden; }
.oc-metrics div { padding: 16px 18px; }
.oc-metrics div + div { border-left: 1px solid rgba(148, 163, 184, .14); }
.oc-metrics b { display: block; color: var(--op-neon); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(0, 229, 153, .35); }
.oc-metrics span { color: #94a3b8; font-size: 12px; }
.oc-brand-foot { color: #64748b; font-size: 12px; }
.oc-brand-foot a { color: #94a3b8; }
.oc-login-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }
.oc-icp { margin: 24px 0 0; font-size: 12px; }
.oc-icp a { color: var(--op-text-3); }
.oc-icp a:hover { color: var(--op-primary); }
.oc-login-card {
    position: relative; box-sizing: border-box; width: 100%; max-width: 400px; padding: 40px 36px; border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, .06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(15, 23, 42, .06), 0 24px 60px rgba(15, 23, 42, .12);
}
.oc-login-card::before { content: ""; position: absolute; left: 36px; right: 36px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, #10b981, #00e599); }
.oc-login-card .oc-muted { margin: 8px 0 8px; }

/* ---------- 选择商户 ---------- */
.oc-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px; box-sizing: border-box; }
.oc-merchant-card { width: 100%; max-width: 440px; padding: 36px; }
.oc-merchant-card .oc-muted { margin: 8px 0 20px; }
.oc-merchant-list { display: grid; gap: 10px; }
.oc-merchant-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; cursor: pointer; text-align: left;
    border: 1px solid var(--op-border); border-radius: var(--op-radius-sm); background: var(--op-surface); transition: all .15s;
}
.oc-merchant-item:hover { border-color: var(--op-primary); background: var(--op-primary-soft); }
.oc-merchant-item strong { flex: 1; font-size: 15px; font-weight: 600; }
.oc-merchant-item span { font-size: 12px; color: var(--op-text-3); }
.oc-merchant-item i { color: var(--op-text-3); }

/* ---------- 主界面 ---------- */
.oc-topbar {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 32px; height: 60px; padding: 0 28px;
    background: var(--op-surface); border-bottom: 1px solid var(--op-border);
}
.oc-nav { display: flex; gap: 4px; flex: 1; }
.oc-nav a { padding: 8px 14px; border-radius: var(--op-radius-sm); color: var(--op-text-2); cursor: pointer; font-size: 14px; }
.oc-nav a:hover { color: var(--op-primary); background: #f8fafc; }
.oc-nav a.active { color: var(--op-primary-hover); background: var(--op-primary-soft); font-weight: 600; box-shadow: inset 0 -2px 0 var(--op-primary); }
.oc-user { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.oc-merchant-name { font-weight: 600; }
.oc-main { max-width: 1200px; margin: 0 auto; padding: 28px; }
.oc-page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.oc-empty { padding: 80px 0; text-align: center; color: var(--op-text-3); }
.oc-empty i { font-size: 44px; }
.oc-empty p { margin: 12px 0 4px; font-size: 15px; color: var(--op-text-2); }

/* 应用卡片 */
.oc-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.oc-app-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.oc-app-card:hover { border-color: var(--op-primary); transform: translateY(-1px); }
.oc-app-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.oc-app-title strong { font-size: 16px; }
.oc-usage > div:first-child { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--op-text-3); }
.oc-usage b { font-size: 20px; color: var(--op-text); margin-left: auto; }
.oc-usage em { font-style: normal; }
.oc-bar { height: 6px; margin-top: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.oc-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10b981, #00e599); box-shadow: 0 0 8px rgba(0, 229, 153, .45); }

/* 应用详情 */
.oc-section { padding: 24px; margin-bottom: 16px; }
.oc-section .oc-app-title { margin-bottom: 18px; justify-content: flex-start; }
.oc-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 24px; margin: 0; }
.oc-dl dt { font-size: 12px; color: var(--op-text-3); margin-bottom: 4px; }
.oc-dl dd { margin: 0; font-size: 14px; }
.oc-secret-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--op-radius-sm); background: #f8fafc; }
.oc-secret-row span { display: inline-block; width: 80px; font-size: 13px; color: var(--op-text-2); }
.oc-section .oc-field:first-of-type { margin-top: 0; }
.oc-section form .layui-btn, .oc-section > .layui-btn { margin-top: 18px; }
form.oc-section > .layui-btn { margin-top: 18px; }
.oc-danger { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: #fecaca; }
.oc-danger h3 { margin-bottom: 4px; color: var(--op-danger); }
.oc-danger p { margin: 0; }

/* 弹窗 */
.oc-dialog { padding: 20px 24px 24px; }
.oc-dialog p { margin: 0 0 14px; line-height: 1.6; color: var(--op-text-2); }
.oc-warn { padding: 10px 12px; border-radius: var(--op-radius-sm); background: var(--op-warning-soft); color: #92400e !important; }
.oc-plain { padding: 14px; border-radius: var(--op-radius-sm); background: #0f172a; }
.oc-plain code { color: #e2e8f0; font-size: 14px; user-select: all; }
.oc-pre { margin: 0; padding: 16px 20px; max-height: 60vh; overflow: auto; font-family: var(--op-mono); font-size: 12px; background: #f8fafc; }

/* 日志 */
.oc-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px; margin-bottom: 16px; }
.oc-filters .layui-input, .oc-filters .oc-select { width: auto; min-width: 150px; flex: 0 1 200px; }
.oc-filters .layui-btn { margin: 0; }
.oc-table-card { overflow: hidden; }
.oc-table-wrap { overflow-x: auto; }
.oc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.oc-table th { padding: 12px 14px; text-align: left; white-space: nowrap; font-weight: 500; color: var(--op-text-3); background: #f8fafc; border-bottom: 1px solid var(--op-border); }
.oc-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.oc-table tr:hover td { background: #f6fdf9; }
.oc-empty-row { text-align: center; color: var(--op-text-3); padding: 40px !important; }
.oc-pager { padding: 8px 14px; text-align: right; }

@media (max-width: 860px) {
    .oc-login-brand { display: none; }
    .oc-topbar { gap: 12px; padding: 0 16px; height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
    .oc-main { padding: 16px; }
    .oc-user .oc-muted { display: none; }
    .oc-danger { flex-direction: column; align-items: flex-start; }
}
