/* ============ 迪粉社区 · 风格A 浅色极简商务 ============ */
:root {
  --bg: #f5f7fc;
  --panel: #ffffff;
  --panel-2: #fafbfe;
  --panel-3: #eef1f9;
  --line: #e5eaf4;
  --line-2: #d7deee;
  --text: #1b2438;
  --dim: #66738f;
  --faint: #98a3b8;
  --acc: #3b5bdb;
  --acc-h: #4a6cf0;
  --acc-2: #7048e8;
  --ok: #1f9d55;
  --warn: #d97706;
  --err: #dc2626;
  --grad: linear-gradient(135deg, #3b5bdb, #4a6cf0);
  --grad-deep: linear-gradient(135deg, #2f4ab8, #3b5bdb);
  --shadow: 0 1px 2px rgba(20, 30, 60, .04);
  --shadow-md: 0 6px 20px rgba(20, 30, 60, .08);
  --radius: 8px;
  --radius-lg: 12px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px; line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.mono { font-family: Consolas, "Courier New", monospace; }

/* ---------- 公告条 ---------- */
#noticeBar {
  position: sticky; top: 0; left: 0; right: 0; z-index: 60;
  padding: 8px 16px; background: var(--grad-deep); color: #fff;
  box-shadow: 0 2px 8px rgba(47, 74, 184, .3);
}
#noticeBar.hidden { display: none; }
.notice-inner {
  max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  color: #fff; font-size: 13px; line-height: 1.5; flex-wrap: wrap;
}
.notice-tag {
  background: rgba(255,255,255,.2); border-radius: 6px; padding: 2px 10px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.notice-inner .btn { margin-left: auto; background: rgba(255,255,255,.94); color: var(--acc); font-weight: 700; border-color: transparent; }

/* ---------- 顶栏（A 风格：细线白条） ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 18px;
  display: flex; align-items: center; gap: 18px; height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--text); white-space: nowrap; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  box-shadow: 0 3px 8px rgba(59, 91, 219, .3);
}
.topnav { display: flex; gap: 2px; align-items: center; }
.topnav a {
  padding: 7px 16px; border-radius: var(--radius); font-size: 14px; color: var(--dim);
  transition: all .15s;
}
.topnav a.active, .topnav a:hover { background: #eef2ff; color: var(--acc); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync-status { font-size: 12px; color: var(--dim); white-space: nowrap; }
.icon-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--dim);
  border-radius: var(--radius); padding: 7px 12px; font-size: 14px;
  transition: all .15s;
}
.icon-btn:hover { border-color: var(--acc); color: var(--acc); }
.dropdown {
  position: absolute; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 8px; min-width: 150px;
}
.lang-wrap { position: relative; }
.dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  border: 0; background: transparent; border-radius: var(--radius); font-size: 13px; color: var(--text);
}
.dropdown button:hover { background: #eef2ff; color: var(--acc); }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 5px;
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.user-chip:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.hidden { display: none !important; }

/* ---------- 主区 ---------- */
#app { max-width: 1180px; margin: 0 auto; padding: 22px 16px 46px; min-height: 62vh; }
footer {
  text-align: center; color: var(--dim); font-size: 12px; padding: 22px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

/* ---------- hero（靛蓝商务） ---------- */
.hero3d {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, #3b5bdb, #4a6cf0 48%, #7048e8);
  box-shadow: 0 10px 26px rgba(59, 91, 219, .28);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 26px 34px; margin-bottom: 20px; min-height: 150px;
}
.hero3d::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.22) 0, transparent 26%),
    radial-gradient(circle at 82% 80%, rgba(255,255,255,.14) 0, transparent 30%);
  pointer-events: none;
}
.hero3d-text { position: relative; z-index: 1; color: #fff; max-width: 520px; }
.hero3d-text h1 { margin: 0 0 8px; font-size: 24px; font-weight: 800; }
.hero3d-text p { margin: 0; font-size: 13.5px; opacity: .92; line-height: 1.6; }
.hero3d-text .hero-chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero3d-text .hero-chips span {
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: 12.5px; padding: 5px 14px; border-radius: 6px;
}
.hero3d-img { position: relative; z-index: 1; width: 46%; max-width: 560px; border-radius: 10px; box-shadow: 0 10px 24px rgba(20, 30, 60, .25); }
@media (max-width: 780px) {
  .hero3d { flex-direction: column; padding: 22px; }
  .hero3d-img { width: 100%; }
}

/* ---------- 首页 ---------- */
.brand-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.brand-pill {
  padding: 8px 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); font-size: 14px; color: var(--dim);
  box-shadow: var(--shadow); transition: all .15s;
}
.brand-pill:hover { border-color: var(--line-2); transform: translateY(-1px); }
.brand-pill.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(59, 91, 219, .3); }
.series-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.series-chip {
  padding: 5px 14px; border-radius: 6px; font-size: 12.5px;
  background: var(--panel); border: 1px solid var(--line); color: var(--dim);
}
.series-chip.active { border-color: var(--acc); color: var(--acc); background: #eef2ff; }
.stats-line { font-size: 13px; color: var(--dim); margin: 6px 0 14px; }
.stats-line b { color: var(--text); }

/* ---------- 卡片与文件列表 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden;
}
.folder-head {
  display: grid; grid-template-columns: 1fr 130px 110px 90px;
  gap: 10px; padding: 13px 20px; font-size: 12.5px; color: var(--dim);
  background: var(--panel-3);
}
.folder-row {
  display: grid; grid-template-columns: 1fr 130px 110px 90px;
  gap: 10px; padding: 13px 20px; font-size: 13.5px; border-top: 1px solid var(--line);
  align-items: center; transition: background .15s;
}
.folder-row:hover { background: var(--panel-2); }
.folder-row .name { font-weight: 600; word-break: break-all; }
.folder-row .name a:hover { color: var(--acc); }
.folder-row .name small { display: block; color: var(--dim); font-weight: 400; font-size: 12px; margin-top: 2px; }
.folder-row .sub { color: var(--dim); font-size: 12.5px; }
.badge {
  display: inline-block; font-size: 11px; padding: 2px 10px; border-radius: 999px;
  background: #eef2ff; color: var(--acc); margin-left: 8px; vertical-align: 1px;
  border: 1px solid rgba(59, 91, 219, .2);
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: var(--radius); padding: 7px 16px; font-size: 13px; font-weight: 600;
  transition: all .15s;
}
.btn:hover { border-color: var(--line-2); filter: brightness(.99); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(59, 91, 219, .28); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(220, 38, 38, .25); }
.btn.sm { padding: 5px 13px; font-size: 12px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.load-more { text-align: center; padding: 16px; }

/* ---------- 搜索 ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.search-input {
  flex: 1; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); font-size: 14px; color: var(--text);
  box-shadow: var(--shadow); outline: none;
}
.search-input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(59, 91, 219, .12); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--dim); font-size: 14px; }
.search-group-title {
  padding: 12px 14px 6px; font-size: 13px; font-weight: 600; color: var(--dim);
  display: flex; align-items: center; gap: 8px;
}
.search-group-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- 个人中心：资料 ---------- */
.avatar-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatar-opt { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 20px; cursor: pointer; }
.avatar-opt.active { border-color: var(--acc); background: #eef2ff; }
.car-add-row { border: 1px dashed var(--line-2); border-radius: var(--radius-lg); padding: 12px; margin-top: 10px; background: var(--panel-2); }
.car-add-row select, .car-add-row input { width: 100%; }

.vin-hint { margin-top: 8px; font-size: 13px; color: var(--warn); }
.ota-sel-row { margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text); }

/* ---------- OTA ---------- */
.ota-brand-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ota-brand { border-radius: var(--radius); padding: 8px 18px; font-size: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; box-shadow: var(--shadow); transition: all .15s; }
.ota-brand:hover { transform: translateY(-1px); }
.ota-brand.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(59, 91, 219, .3); }
.oq-pick { min-width: 130px; }
.oq-layer { position: absolute; z-index: 60; margin-top: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 10px; min-width: 220px; max-width: 340px; }
.oq-layer-title { font-size: 13px; font-weight: 700; color: var(--dim); padding: 4px 8px 8px; }
.oq-search { width: 100%; box-sizing: border-box; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line); font-size: 13px; margin-bottom: 6px; outline: none; }
.oq-list { max-height: 280px; overflow: auto; }
.oq-group { font-size: 12px; font-weight: 700; color: var(--dim); padding: 8px 8px 4px; }
.oq-opt { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius); border: 0; background: transparent; color: var(--text); font-size: 13px; cursor: pointer; }
.oq-opt:hover { background: #eef2ff; }
.oq-empty { padding: 12px 8px; color: var(--dim); font-size: 13px; }
.ota-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.ota-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); transition: all .15s; }
.ota-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ota-card .car-title { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.ota-card .vin { color: var(--dim); font-size: 12.5px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 10px; border-radius: 999px; margin-top: 8px; font-weight: 600; }
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; flex: 0 0 5px; }
.tag.ok { background: rgba(31, 157, 85, .1); color: #1f9d55; }
.tag.ok::before { background: var(--ok); }
.tag.wait { background: rgba(217, 119, 6, .1); color: #b45309; }
.tag.wait::before { background: var(--warn); }
.tag.err { background: rgba(220, 38, 38, .1); color: #b91c1c; }
.tag.err::before { background: var(--err); }
.tag.vip { background: rgba(112, 72, 232, .1); color: #7048e8; }
.tag.vip::before { background: var(--acc-2); }
.ota-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ota-form select, .ota-form input { padding: 9px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 14px; box-shadow: var(--shadow); outline: none; }

/* ---------- 表单 ---------- */
.form-card { max-width: 460px; margin: 34px auto; padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow-md); background: var(--panel); }
.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; font-weight: 600; }
.form-row input, .form-row select {
  width: 100%; padding: 10px 13px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 14px; outline: none;
  box-shadow: var(--shadow);
}
.form-row input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(59, 91, 219, .12); }
.form-input { width: 100%; padding: 10px 13px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 14px; outline: none; }
.form-err { color: var(--err); font-size: 13px; margin: 8px 0; }
.form-ok { color: var(--ok); font-size: 13px; margin: 8px 0; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(40, 55, 100, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px 26px;
  width: 420px; max-width: 92vw; max-height: 86vh; overflow: auto;
  box-shadow: 0 20px 50px rgba(20, 30, 60, .25);
}
.modal h3 { margin: 0 0 16px; font-size: 18px; font-weight: 700; }
.modal-close { float: right; border: 0; background: transparent; font-size: 20px; color: var(--dim); }
.tabs { display: flex; gap: 2px; margin-bottom: 18px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; width: fit-content; }
.tabs button {
  border: 0; background: transparent; padding: 8px 18px; font-size: 14px; color: var(--dim);
  border-radius: 6px; font-weight: 600; transition: all .15s;
}
.tabs button.active { background: var(--panel); color: var(--acc); box-shadow: 0 1px 3px rgba(20, 30, 60, .08); }

/* ---------- 个人中心 ---------- */
.profile-grid { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } }
.side-nav { padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); height: fit-content; }
.side-nav button {
  display: block; width: 100%; text-align: left; padding: 10px 16px; border: 0;
  background: transparent; border-radius: var(--radius); font-size: 14px; color: var(--dim);
  font-weight: 600; transition: all .15s;
}
.side-nav button:hover { background: #eef2ff; color: var(--acc); }
.side-nav button.active { background: var(--grad); color: #fff; }
.section { padding: 22px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.section h3 { margin: 0 0 16px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 14px; margin-bottom: 14px; }
.kv dt { color: var(--dim); }
.car-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 9px; font-size: 13.5px; background: var(--panel); }

/* ---------- 后台管理（侧边栏布局，A 风格） ---------- */
.admin-layout { display: grid; grid-template-columns: 216px 1fr; gap: 18px; align-items: start; }
.admin-side {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  max-height: calc(100vh - 96px); overflow-y: auto;
}
.admin-side .side-group { font-size: 10.5px; color: var(--faint); padding: 12px 12px 4px; letter-spacing: 1.2px; font-weight: 600; }
.admin-side .side-sub { margin-left: 0; }
.admin-side button {
  text-align: left; padding: 8.5px 12px; border: 0;
  background: transparent; border-radius: var(--radius); font-size: 13px; color: var(--dim);
  font-weight: 600; transition: all .15s; white-space: nowrap;
}
.admin-side button:hover { background: var(--panel-2); color: var(--text); }
.admin-side button.active { background: #eef2ff; color: var(--acc); font-weight: 600; }
.admin-main { min-width: 0; }
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; flex-direction: row; overflow-x: auto; border-radius: var(--radius-lg); }
  .admin-side .side-group { display: none; }
}

/* ---------- 后台 tab 与表格 ---------- */
.admin-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 18px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; width: fit-content; }
.admin-tabs button {
  padding: 7px 16px; border-radius: 6px; border: 0;
  background: transparent; color: var(--dim); font-size: 13.5px; font-weight: 600;
  transition: all .15s;
}
.admin-tabs button.active { background: var(--panel); color: var(--acc); box-shadow: 0 1px 3px rgba(20, 30, 60, .08); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table th { color: var(--faint); font-weight: 600; font-size: 11.5px; letter-spacing: .4px; background: var(--panel-3); }
.admin-table tr:hover td { background: var(--panel-2); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { color: var(--faint); font-weight: 600; font-size: 11.5px; background: var(--panel-3); }
.data-table tr:hover td { background: var(--panel-2); }

/* ---------- 排序 / 开关 / 更多 ---------- */
.sort-btn { border: 0; background: transparent; font-size: 12.5px; color: var(--dim); text-align: left; cursor: pointer; padding: 0; }
.sort-btn .arrow, .sort-arrow { color: var(--acc); }
.sort-btn.on { color: var(--acc); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.switch input { display: none; }
.switch span { width: 40px; height: 22px; border-radius: 999px; background: #d7ddee; position: relative; transition: background .2s; box-shadow: inset 0 1px 3px rgba(20,30,60,.12); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 2px 5px rgba(20,30,60,.25); }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { left: 21px; }
.admin-table .btn.sm { white-space: nowrap; }

/* ---------- 业务页补充类 ---------- */
.cat-crumb { font-size: 12.5px; color: var(--dim); margin-bottom: 10px; }
.cat-crumb a:hover { color: var(--acc); }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 7px; background: var(--panel); font-size: 13px; cursor: pointer; }
.cat-row:hover { border-color: var(--line-2); background: var(--panel-2); }
.cat-row .name { font-weight: 600; flex: 1; }
.md-crumb { font-size: 12.5px; color: var(--dim); margin-bottom: 10px; }
.md-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 7px; background: var(--panel); font-size: 13px; }
.md-row:hover { background: var(--panel-2); }
.nt-cand { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; background: var(--panel); }
.nt-cand:hover { border-color: var(--line-2); }
.perm-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.perm-chk input { accent-color: var(--acc); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; color: var(--dim); font-weight: 600; }
.fail { color: var(--err); }
.same { font-size: 12.5px; color: var(--dim); }
.rm { color: var(--err); cursor: pointer; }
.cp { cursor: pointer; }
.dl { cursor: pointer; color: var(--acc); }
.scroll-sentinel { height: 1px; }

@media (max-width: 720px) {
  .folder-head, .folder-row { grid-template-columns: 1fr 90px; }
  .folder-head .col-time, .folder-head .col-size, .folder-row .col-time, .folder-row .col-size { display: none; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .topbar-right { width: 100%; justify-content: flex-end; }
}

/* ============ 响应式适配（手机/平板） ============ */

/* 表格容器：横向滚动 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 640px; }

/* 平板 ≤1024px */
@media (max-width: 1024px) {
  #app { padding: 16px 12px 40px; }
  .topbar-inner { gap: 10px; padding: 0 12px; }
  .topnav a { padding: 7px 10px; font-size: 13px; }
  #topSearch { width: 120px !important; }
  .ota-grid { grid-template-columns: 1fr; }
  .hero3d { padding: 20px; }
}

/* 手机 ≤768px */
@media (max-width: 768px) {
  body { font-size: 13px; }
  #app { padding: 12px 10px 32px; }
  .card { border-radius: 10px; }
  .section { padding: 16px 14px; }
  .modal { padding: 18px 16px; border-radius: 12px; }
  .form-card { margin: 16px auto; padding: 20px 16px; }

  /* 顶栏：手机上三行布局 */
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 6px; }
  .brand { font-size: 14px; flex: 0 0 auto; }
  .brand span { display: inline !important; }
  .topnav { order: 3; width: 100%; justify-content: space-around; }
  .topnav a { flex: 1; text-align: center; padding: 6px 4px; font-size: 13px; }
  .topbar-right { order: 2; flex: 1; min-width: 0; justify-content: flex-end; gap: 6px; }
  .sync-status { display: none; }
  #topSearch { flex: 1; min-width: 0; }
  .user-chip span { display: none; }
  .user-chip { padding: 4px; }

  /* hero */
  .hero3d { padding: 18px 16px; min-height: auto; }
  .hero3d-text h1 { font-size: 20px; }
  .hero3d-text p { font-size: 12.5px; }
  .hero3d-text .hero-chips span { font-size: 11.5px; padding: 4px 10px; }

  /* 文件列表 */
  .folder-head, .folder-row { padding: 10px 12px; gap: 6px; }
  .folder-row .name { font-size: 13px; }

  /* 个人中心 */
  .kv { grid-template-columns: 80px 1fr; font-size: 13px; }
  .side-nav { display: flex; overflow-x: auto; gap: 2px; padding: 6px; }
  .side-nav button { white-space: nowrap; flex: 0 0 auto; }

  /* 后台管理 */
  .admin-layout { gap: 10px; }
  .admin-main { min-width: 0; }
  .admin-tabs { width: 100%; overflow-x: auto; }
  .admin-tabs button { white-space: nowrap; }

  /* 表格：外层横向滚动 */
  .card:has(table) { overflow-x: auto; }
  .admin-table, .data-table { font-size: 12.5px; min-width: 600px; }
  .admin-table th, .admin-table td, .data-table th, .data-table td { padding: 8px 8px; }

  /* OTA 查询 */
  .ota-form { flex-direction: column; align-items: stretch; }
  .ota-form select, .ota-form input { width: 100%; }
  .oq-layer { position: fixed; left: 10px; right: 10px; min-width: 0; max-width: none; }

  /* 弹窗按钮 */
  .modal .btn { width: 100%; justify-content: center; }

  /* 搜索 */
  .search-bar { flex-direction: column; }
  .search-input { font-size: 13px; }
}

/* 小手机 ≤420px */
@media (max-width: 420px) {
  .brand-pill { padding: 6px 12px; font-size: 13px; }
  .btn { padding: 6px 12px; font-size: 12.5px; }
  .folder-row .row-actions .btn { padding: 4px 8px; font-size: 11.5px; }
}
/* ============ 全站通用响应式兜底 ============ */

/* 手机上所有输入框/选择框不溢出 */
@media (max-width: 768px) {
  input, select, textarea { max-width: 100% !important; box-sizing: border-box; }
  button { max-width: 100%; }
  
  /* 所有 flex 行允许换行（覆盖 inline style 没写 flex-wrap 的） */
  div[style*="display:flex"] { flex-wrap: wrap; }
  div[style*="display: flex"] { flex-wrap: wrap; }
  
  /* 所有 grid 在手机上尽量单列（宽 >400px 的） */
  div[style*="display:grid"] { grid-template-columns: 1fr !important; }
  
  /* 固定宽度的 inline style 输入框自适应 */
  input[style*="width:"], select[style*="width:"], .search-input[style*="width:"] {
    width: 100% !important;
  }
  
  /* 卡片 padding 缩小 */
  .card[style*="padding"] { padding: 12px !important; }
  
  /* 弹窗内按钮组竖排 */
  .modal .row-actions, .modal div[style*="justify-content:flex-end"] {
    flex-direction: column;
  }
  .modal .row-actions .btn, .modal div[style*="justify-content:flex-end"] .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* OTA 查询结果卡片 */
  .ota-card { padding: 14px; }
  
  /* 个人中心设备列表 */
  .device-item, .car-item { flex-wrap: wrap; }
  
  /* 后台统计卡片行 */
  .stat-row, .admin-cards > div { min-width: 0; }
}

/* 平板通用兜底 */
@media (max-width: 1024px) {
  .notice-inner { font-size: 12px; }
  .brand-pill { padding: 6px 14px; font-size: 13px; }
}