/* ============================================================
   挖机租 · 设计系统 —— 工业精致风（Industrial Refined）
   炭黑 × 工程黄 · 工程图纸质感 · 克制留白
   ============================================================ */

:root {
    --bg: #f4f3ef;
    --surface: #ffffff;
    --ink: #1b1e22;
    --ink-2: #5d6470;
    --ink-3: #9aa1ab;
    --line: #e6e3da;
    --line-strong: #d8d4c8;
    --accent: #f5a800;
    --accent-deep: #dd9600;
    --accent-soft: #fdf3dd;
    --dark: #15171b;
    --dark-2: #202329;
    --dark-line: rgba(255, 255, 255, 0.09);
    --ok: #1e8e4f;
    --ok-bg: #e3f3e9;
    --danger: #cf4545;
    --danger-bg: #fbeae8;
    --info: #2b6cb0;
    --info-bg: #e8f0f9;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(23, 24, 28, 0.05);
    --shadow-md: 0 6px 18px rgba(23, 24, 28, 0.07);
    --shadow-lg: 0 16px 40px rgba(23, 24, 28, 0.13);
    --font-body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-deep);
}

::selection {
    background: var(--accent);
    color: var(--dark);
}

/* ---------- 入场动画 ---------- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > * {
    animation: fadeUp 0.55s cubic-bezier(0.22, 0.9, 0.32, 1) both;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease,
        border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--dark);
}

.btn-primary:hover {
    background: var(--dark);
    border-color: var(--dark);
    color: var(--accent);
    box-shadow: 0 8px 20px rgba(21, 23, 27, 0.25);
}

.btn-lg {
    padding: 13px 32px;
    font-size: 15px;
    letter-spacing: 0.02em;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12.5px;
    border-radius: 6px;
}

.btn-block {
    width: 100%;
}

.required-mark {
    color: #e53935;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b23636;
    border-color: #b23636;
    color: #fff;
}

.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- 头部导航（炭黑工业条） ---------- */
.site-header {
    background: var(--dark);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--dark-line);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
}

.logo {
    font-size: 21px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.logo::before {
    content: "";
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 2px;
    transform: rotate(45deg);
    flex: none;
}

.logo:hover {
    color: var(--accent);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 26px;
}

.site-nav a {
    color: rgba(255, 255, 255, 0.72);
    font-size: 14.5px;
    font-weight: 500;
    position: relative;
    padding: 4px 0;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.site-nav a:hover {
    color: #fff;
}

.site-nav a:hover::after {
    width: 100%;
}

.nav-user {
    color: var(--ink-3);
    font-size: 13.5px;
}

.site-nav .btn-link {
    background: var(--accent);
    color: var(--dark) !important;
    padding: 7px 16px;
    border-radius: 7px;
    font-weight: 600;
}

.site-nav .btn-link::after {
    display: none;
}

.site-nav .btn-link:hover {
    background: #fff;
    color: var(--dark) !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* ---------- 主内容 ---------- */
.main-content {
    min-height: calc(100vh - 62px - 64px);
    padding: 32px 20px 48px;
}

/* ---------- Hero（工程图纸深色块） ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 76px 56px;
    background: var(--dark);
    color: #fff;
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), transparent 70%);
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 18px;
}

.hero-eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    background: var(--accent);
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: 0.01em;
    margin-bottom: 16px;
}

.hero-sub {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.66);
    max-width: 560px;
    margin-bottom: 32px;
}

.hero .btn-primary {
    border-color: var(--accent);
}

.hero .btn-primary:hover {
    background: #fff;
    border-color: #fff;
    color: var(--dark);
}

/* ---------- 首页特性 ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 30px 28px 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: fadeUp 0.55s cubic-bezier(0.22, 0.9, 0.32, 1) both;
}

.feature-card:nth-child(2) { animation-delay: 0.08s; }
.feature-card:nth-child(3) { animation-delay: 0.16s; }

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-num {
    display: block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--accent-deep);
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--ink-2);
}

/* ---------- 提示 ---------- */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    border-left-width: 4px;
}

.alert::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.alert-success {
    background: var(--ok-bg);
    color: var(--ok);
    border-left-color: var(--ok);
}

.alert-danger,
.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-left-color: var(--danger);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-left-color: var(--info);
}

/* ---------- 页脚 ---------- */
.site-footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    padding: 22px 0;
    margin-top: 48px;
    font-size: 13.5px;
    border-top: 3px solid var(--accent);
}

/* ---------- 表单 ---------- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fbfaf7;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--ink-3);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(245, 168, 0, 0.18);
}

/* ---------- 认证页 ---------- */
.auth-box {
    position: relative;
    max-width: 420px;
    margin: 48px auto;
    background: var(--surface);
    padding: 40px 36px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.auth-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 26px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.auth-tip {
    text-align: center;
    margin-top: 18px;
    color: var(--ink-2);
    font-size: 13.5px;
}

.auth-tip a {
    color: var(--accent-deep);
    font-weight: 600;
}

/* ---------- 个人资料 ---------- */
.profile-info {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.profile-label {
    color: var(--ink-2);
    font-size: 14px;
}

.profile-value {
    font-weight: 600;
    color: var(--ink);
    font-size: 16px;
    letter-spacing: 0.5px;
}

/* ---------- 角色标签 ---------- */
.role-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.role-admin {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.role-user {
    background: var(--info-bg);
    color: var(--info);
}

/* ---------- 页面标题 ---------- */
.page-title {
    margin-bottom: 22px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title::before {
    content: "";
    width: 6px;
    height: 22px;
    background: var(--accent);
    border-radius: 2px;
    flex: none;
}

/* ---------- 筛选面板 ---------- */
.filter-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 20px 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 26px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-item {
    flex: 1 1 170px;
    min-width: 140px;
}

.filter-item label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.filter-item select,
.filter-item input {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fbfaf7;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-item select:focus,
.filter-item input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(245, 168, 0, 0.18);
}

.price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-range span {
    color: var(--ink-3);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* ---------- 挖掘机卡片网格 ---------- */
.excavator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.excavator-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: fadeUp 0.5s cubic-bezier(0.22, 0.9, 0.32, 1) both;
}

.excavator-card:nth-child(4n + 2) { animation-delay: 0.05s; }
.excavator-card:nth-child(4n + 3) { animation-delay: 0.1s; }
.excavator-card:nth-child(4n + 4) { animation-delay: 0.15s; }

.excavator-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.excavator-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.excavator-card:hover::before {
    transform: scaleX(1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.brand-tag {
    background: var(--dark);
    color: #fff;
    padding: 3px 11px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.tonnage-tag {
    background: var(--accent-soft);
    color: var(--accent-deep);
    border: 1px solid rgba(245, 168, 0, 0.35);
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

.card-model {
    font-size: 17.5px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

.card-specs {
    font-size: 13px;
    color: var(--ink-2);
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.card-location {
    font-size: 13px;
    color: var(--ink-3);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-location::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    margin-bottom: 14px;
    margin-top: auto;
}

.price {
    font-size: 21px;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.price small {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-3);
}

.status {
    font-size: 12.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-ok {
    background: var(--ok-bg);
    color: var(--ok);
}

.status-off {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--ink-2);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-link:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.page-link.active {
    background: var(--dark);
    color: var(--accent);
    border-color: var(--dark);
}

.page-ellipsis {
    padding: 8px 6px;
    color: var(--ink-3);
}

/* ---------- 详情页 ---------- */
.detail-container {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    color: var(--accent-deep);
}

.detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-title h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.detail-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    margin-top: 24px;
}

.detail-section {
    margin-bottom: 26px;
}

.detail-section h3 {
    margin-bottom: 14px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-section h3::before {
    content: "";
    width: 5px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-table th,
.spec-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.spec-table th {
    width: 130px;
    color: var(--ink-2);
    font-weight: 600;
    background: #faf9f5;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
    border-bottom: none;
}

.description {
    line-height: 1.85;
    color: var(--ink-2);
    font-size: 14.5px;
}

.detail-sidebar {
    position: sticky;
    top: 84px;
    align-self: start;
}

.price-box {
    background: var(--dark);
    color: #fff;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.price-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
}

.price-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.price-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.price-value small {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
}

.availability {
    margin-top: 12px;
}

.detail-sidebar .btn {
    margin-bottom: 10px;
}

/* ---------- 订单页 ---------- */
.order-create,
.order-detail-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    max-width: 640px;
    margin: 0 auto;
}

.order-summary {
    background: #faf9f5;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 22px;
}

.order-summary h3 {
    margin-bottom: 8px;
    font-size: 17px;
}

.order-summary p {
    color: var(--ink-2);
    font-size: 14px;
}

.order-summary .price {
    color: var(--accent-deep);
    font-size: 18px;
    margin-top: 6px;
}

.order-form-box .btn {
    margin-bottom: 10px;
}

.order-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #faf9f5;
    border: 1px solid var(--line);
    padding: 13px 18px;
    border-radius: var(--radius);
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
}

.order-no {
    font-family: "Archivo", ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
    font-size: 13.5px;
    letter-spacing: 0.03em;
}

.status-badge {
    padding: 4px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-待确认 { background: var(--accent-soft); color: var(--accent-deep); }
.status-已确认 { background: var(--info-bg); color: var(--info); }
.status-进行中 { background: var(--ok-bg); color: var(--ok); }
.status-已完成 { background: #eceae4; color: var(--ink-2); }
.status-已取消 { background: var(--danger-bg); color: var(--danger); }

/* ---------- 数据表格 ---------- */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.data-table th {
    background: #faf9f5;
    color: var(--ink-2);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: #faf9f5;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* ---------- 后台管理 ---------- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 4px;
}

.admin-header .page-title {
    margin-bottom: 0;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 20px 18px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.stat-label {
    color: var(--ink-2);
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
}

.admin-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.action-cell {
    white-space: nowrap;
}

.action-cell form {
    display: inline;
}

/* ---------- 表单布局 ---------- */
.form-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    max-width: 820px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-weight: 500;
    color: var(--ink-2);
}

.checkbox-group input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form select {
    padding: 5px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fbfaf7;
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 72px 24px;
    color: var(--ink-3);
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 18px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
    .excavator-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 62px;
        left: 0;
        right: 0;
        background: var(--dark-2);
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 20px;
        border-bottom: 3px solid var(--accent);
    }

    .site-nav.open {
        display: flex;
    }

    .hero {
        padding: 52px 28px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-sub {
        font-size: 14.5px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .excavator-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-body {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-title {
        font-size: 22px;
    }

    .detail-container,
    .order-create,
    .order-detail-box,
    .form-box {
        padding: 20px;
    }

    .auth-box {
        margin: 28px auto;
        padding: 32px 24px 28px;
    }
}

@media (max-width: 480px) {
    .excavator-grid {
        grid-template-columns: 1fr;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 44px 22px;
    }

    .hero h1 {
        font-size: 25px;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-actions .btn {
        flex: 1;
    }
}

/* ============================================================
   在线客服（客户端聊天窗 + 后台工作台 + 悬浮入口）
   ============================================================ */

/* ---------- 悬浮客服入口 ---------- */
.cs-float {
    position: fixed;
    right: 22px;
    bottom: 26px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--dark);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s ease, background 0.2s ease;
}

.cs-float:hover {
    color: var(--dark);
    background: var(--accent);
    transform: translateY(-2px);
}

.cs-float-icon {
    font-size: 17px;
}

/* ---------- 聊天窗骨架 ---------- */
.chat-shell {
    max-width: 860px;
    margin: 18px auto 40px;
    height: calc(100vh - 190px);
    min-height: 460px;
    max-height: 720px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.chat-header {
    padding: 14px 20px;
    background: var(--dark);
    color: #fff;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.chat-title {
    font-size: 16px;
    font-weight: 700;
}

.chat-status {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.62);
}

/* ---------- 消息区 ---------- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 22px 20px;
    background:
        linear-gradient(var(--bg), var(--bg)) center / 100% 100% no-repeat,
        var(--bg);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-welcome {
    margin: auto;
    max-width: 420px;
    text-align: center;
    color: var(--ink-2);
    font-size: 14px;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.chat-welcome p + p {
    margin-top: 8px;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 72%;
}

.chat-msg-self {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-msg-other {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.6;
    word-break: break-word;
    box-shadow: var(--shadow-sm);
}

.chat-msg-self .chat-bubble {
    background: var(--accent-soft);
    border: 1px solid #f0dcae;
    border-bottom-right-radius: 4px;
}

.chat-msg-other .chat-bubble {
    background: var(--surface);
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
}

.chat-time {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--ink-3);
}

.chat-img {
    display: block;
    max-width: 240px;
    max-height: 240px;
    border-radius: 8px;
    cursor: zoom-in;
    object-fit: cover;
}

.chat-video {
    display: block;
    max-width: 300px;
    max-height: 240px;
    border-radius: 8px;
    background: #000;
}

.chat-voice {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.chat-voice audio {
    height: 36px;
    max-width: 230px;
}

.voice-icon {
    font-size: 18px;
}

/* ---------- 定位消息卡片 ---------- */
.chat-loc {
    min-width: 240px;
    max-width: 300px;
}

.chat-loc-head {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    word-break: break-all;
}

.chat-loc-map {
    display: block;
    width: 100%;
    height: 160px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
}

.chat-loc-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--info);
}

.chat-loc-link:hover {
    text-decoration: underline;
}

/* ---------- 输入区 ---------- */
.chat-tip {
    flex-shrink: 0;
    padding: 8px 18px;
    font-size: 13px;
    color: var(--info);
    background: var(--info-bg);
    border-top: 1px solid var(--line);
}

.chat-tip-error {
    color: var(--danger);
    background: var(--danger-bg);
}

.chat-composer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.composer-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    border-radius: 50%;
    font-size: 17px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
}

.composer-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.composer-btn.recording {
    background: var(--danger-bg);
    border-color: var(--danger);
    animation: recPulse 1.2s ease-in-out infinite;
}

@keyframes recPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(207, 69, 69, 0.35); }
    50% { box-shadow: 0 0 0 7px rgba(207, 69, 69, 0); }
}

#chatInput {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 14.5px;
    font-family: inherit;
    background: var(--bg);
}

#chatInput:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}

.chat-send {
    flex-shrink: 0;
    padding: 0 22px;
    height: 40px;
    border-radius: 999px;
}

.chat-record-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-top: 1px solid var(--line);
    background: var(--danger-bg);
    font-size: 13.5px;
}

.chat-record-bar[hidden] {
    display: none;
}

.rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    animation: recPulse 1s ease-in-out infinite;
}

/* ---------- 后台客服工作台 ---------- */
.chat-workshop {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    margin: 18px 0 40px;
    height: calc(100vh - 190px);
    min-height: 480px;
    max-height: 760px;
}

.conv-list {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.conv-list-title {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 14px;
    background: var(--dark);
    color: #fff;
}

.conv-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s ease;
}

.conv-item:hover {
    background: var(--accent-soft);
}

.conv-active {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

.conv-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.conv-name {
    font-weight: 600;
    font-size: 14px;
}

.conv-time {
    font-size: 11.5px;
    color: var(--ink-3);
    flex-shrink: 0;
}

.conv-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.conv-snippet {
    font-size: 12.5px;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv-unread {
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.conv-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--ink-3);
    font-size: 13.5px;
}

.chat-panel {
    min-width: 0;
}

.chat-panel .chat-shell {
    margin: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: none;
}

.chat-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    color: var(--ink-2);
}

/* ---------- 客服设置页 ---------- */
.cs-settings-box {
    max-width: 560px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
}

.checkbox-label input {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .chat-workshop {
        grid-template-columns: 1fr;
        height: auto;
    }

    .conv-list {
        max-height: 220px;
    }

    .chat-panel .chat-shell {
        height: calc(100vh - 240px);
    }

    .chat-msg {
        max-width: 85%;
    }

    .cs-float span:last-child {
        display: none;
    }

    .cs-float {
        padding: 13px;
    }
}

@media (max-width: 480px) {
    .chat-shell {
        height: calc(100vh - 150px);
        border-radius: var(--radius);
    }

    .chat-img {
        max-width: 190px;
        max-height: 190px;
    }

    .chat-video {
        max-width: 220px;
    }

    .chat-loc {
        min-width: 200px;
        max-width: 240px;
    }

    .chat-loc-map {
        height: 130px;
    }

    .composer-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .chat-send {
        padding: 0 16px;
    }
}

/* ============================================================
   设备图片（后台上传 → 客户端展示）
   ============================================================ */

/* 后台表单：当前图片预览 */
.ex-current-img {
    margin-bottom: 10px;
}

.ex-current-img img {
    display: block;
    max-width: 260px;
    max-height: 180px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: cover;
}

.ex-remove-label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--danger);
}

/* 后台列表缩略图 */
.ex-thumb {
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
    vertical-align: middle;
}

.ex-thumb-none {
    font-size: 12px;
    color: var(--ink-3);
}

/* 订单页联系客户按钮 */
.contact-btn {
    margin-left: 6px;
    white-space: nowrap;
}

/* 订单留言备注 */
.admin-note-cell {
    max-width: 180px;
    font-size: 12.5px;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-note {
    white-space: pre-wrap;
    max-width: 420px;
}

/* 留言查看弹窗（后台订单列表） */
.note-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 12.5px;
    color: var(--info);
    cursor: pointer;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

.note-link:hover {
    text-decoration: underline;
    color: var(--accent);
}

.note-dialog {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0;
    max-width: 480px;
    width: calc(100vw - 48px);
}

.note-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.note-dialog-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--dark);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
}

.note-dialog-order {
    flex: 1;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-dialog-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.note-dialog-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.note-dialog-body {
    padding: 18px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 60vh;
    overflow-y: auto;
    color: var(--ink);
    background: var(--surface);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* 设备手动排序 */
.sort-tip {
    font-size: 13px;
    color: var(--ink-3);
    margin: 8px 0 10px;
}

.sort-status {
    display: none;
    font-size: 13px;
    color: var(--ok);
    margin-bottom: 8px;
}

.sort-status.show {
    display: block;
}

.sort-status.error {
    color: var(--danger);
}

.sort-col {
    width: 72px;
    white-space: nowrap;
    text-align: center;
}

.drag-handle {
    cursor: grab;
    color: var(--ink-3);
    font-size: 15px;
    user-select: none;
    margin-right: 4px;
}

.drag-handle:hover {
    color: var(--accent);
}

.drag-handle:active {
    cursor: grabbing;
}

.sort-btns {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    vertical-align: middle;
}

.sort-btn {
    border: none;
    background: none;
    color: var(--ink-3);
    font-size: 9px;
    line-height: 1;
    padding: 2px 3px;
    cursor: pointer;
    border-radius: 3px;
}

.sort-btn:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.sortable-table tbody tr {
    transition: background 0.12s ease, opacity 0.12s ease;
}

.sortable-table tbody tr.dragging {
    opacity: 0.45;
    background: var(--accent-soft);
}

/* 用户端域名设置 */
.domain-preview {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13.5px;
}

.domain-preview-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.domain-preview-label {
    color: var(--ink-2);
    white-space: nowrap;
}

.domain-preview-auto,
.domain-banner-auto {
    color: var(--ink-3);
}

.domain-sample {
    flex: 1;
    min-width: 220px;
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-size: 13px;
    color: var(--ink-2);
    background: var(--bg);
}

.domain-banner {
    margin-top: 18px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13.5px;
}

/* 客户端列表卡片图 */
.ex-card-imgwrap {
    display: block;
    margin: -21px -21px 14px; /* 抵消 .excavator-card 的 20px padding 与 1px 边框 */
}

.ex-card-img {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.ex-card-img-none {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--accent-soft) 100%);
    color: var(--ink-3);
}

/* 客户端详情页大图 */
.ex-detail-imgwrap {
    text-align: center;
}

.ex-detail-img {
    display: block;
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: zoom-in;
}

@media (max-width: 480px) {
    .ex-card-img {
        height: 140px;
    }

    .ex-detail-img {
        max-height: 240px;
    }
}


