/* ============================================================
   金价行情 · 手机端门店价格牌
   配色沿用门店行情牌习惯：暖金 + 棕边 + 红涨绿跌
   ============================================================ */

:root {
    --gold-1: #a8701f;
    --gold-2: #7a4a12;
    --gold-3: #c69c6d;

    --line: #e5d7bd;
    --line-strong: #d8c39d;

    --bg: #f3ece0;
    --card: #ffffff;

    --ink: #33302b;
    --ink-2: #6c6455;
    --ink-3: #9a917f;

    --buy: #8a4b12;   /* 回购 */
    --sell: #0f5c9c;  /* 销售 */

    --up: #d0342c;    /* 涨 红 */
    --down: #178a4c;  /* 跌 绿 */

    --radius: 12px;
    --nav-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

.phone {
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
    position: relative;
}

/* 后台把底部按键全部删掉/隐藏时，不要再留一条导航的空白 */
.phone.no-nav {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
}

/* ------------------------------------------------------------- 顶部 */

.hd {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(135deg, var(--gold-2) 0%, var(--gold-1) 55%, #b8812c 100%);
    color: #fff;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 10px;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 14px rgba(122, 74, 18, .25);
}

.hd-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hd-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.hd-mark {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .5px;
    color: #5d3608;
    background: linear-gradient(160deg, #ffe6a8, #e8bf6a);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .6), 0 2px 6px rgba(0, 0, 0, .18);
}

.hd-title { min-width: 0; }
.hd-title h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hd-title p {
    margin: 1px 0 0;
    font-size: 11px;
    opacity: .82;
    letter-spacing: .3px;
}

.hd-right { flex: 0 0 auto; text-align: right; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .38);
    color: #fff;
}
.badge.is-open {
    background: rgba(23, 138, 76, .92);
    border-color: rgba(255, 255, 255, .5);
    animation: pulse 2.4s ease-in-out infinite;
}
.badge.is-closed {
    background: rgba(90, 78, 60, .55);
    border-color: rgba(255, 255, 255, .28);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(23, 138, 76, .55); }
    50%      { box-shadow: 0 0 0 5px rgba(23, 138, 76, 0); }
}

.hd-time {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .8px;
}

.hd-hint {
    margin-top: 8px;
    font-size: 11.5px;
    opacity: .85;
    letter-spacing: .2px;
    min-height: 16px;
}

/* ------------------------------------------------------------- 主体 */

.main { padding: 12px 12px 0; }

.card {
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(122, 74, 18, .07);
}

.card-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #fdf8ef, #f7efe0);
    border-bottom: 1px solid var(--line);
}
.card-title h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #7a4a12;
    letter-spacing: .5px;
}
.card-title h2::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 13px;
    margin-right: 7px;
    vertical-align: -1px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
}
.card-title .note { font-size: 11px; color: var(--ink-3); }

/* ------------------------------------------------------------- 表格 */

.tbl {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.tbl th {
    padding: 9px 4px;
    font-size: 13px;
    font-weight: 600;
    color: #8a6a3a;
    background: #faf5ea;
    border-bottom: 1px solid var(--line);
    letter-spacing: .5px;
}

.tbl td {
    padding: 0 4px;
    height: 48px;
    text-align: center;
    vertical-align: middle;
    font-size: 16.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .2px;
    border-bottom: 1px solid #f1e9da;
    white-space: nowrap;
    transition: background-color .5s ease;
}

.tbl tbody tr:last-child td { border-bottom: 0; }

.tbl-4 th:first-child, .tbl-4 td:first-child { width: 27%; }
.tbl-4 th:nth-child(2), .tbl-4 td:nth-child(2) { width: 25%; }
.tbl-4 th:nth-child(3), .tbl-4 td:nth-child(3) { width: 25%; }
.tbl-4 th:nth-child(4), .tbl-4 td:nth-child(4) { width: 23%; }

.tbl-3 th:first-child, .tbl-3 td:first-child { width: 36%; }
.tbl-3 th:nth-child(2), .tbl-3 td:nth-child(2) { width: 34%; }
.tbl-3 th:nth-child(3), .tbl-3 td:nth-child(3) { width: 30%; }

.name-cell {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: .5px;
}

.buy { color: var(--buy); }
.sell { color: var(--sell); }
.time-cell {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

/* 红涨绿跌（相对上一次刷新） */
.tbl td.up   { color: var(--up) !important; }
.tbl td.down { color: var(--down) !important; }

@keyframes flashUp {
    0%   { background-color: rgba(208, 52, 44, .22); }
    100% { background-color: transparent; }
}
@keyframes flashDown {
    0%   { background-color: rgba(23, 138, 76, .20); }
    100% { background-color: transparent; }
}
.tbl td.flash-up   { animation: flashUp 1s ease-out; }
.tbl td.flash-down { animation: flashDown 1s ease-out; }

.tbl tr.ph td {
    height: 60px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
}

.tbl-foot {
    margin: 0;
    padding: 8px 12px 10px;
    font-size: 11px;
    color: var(--ink-3);
    background: #fdfaf4;
    border-top: 1px dashed var(--line);
}

/* 表格上方的免责提示：读起来要显眼，但不能抢走价格本身的注意力 */
.tbl-note {
    margin: 0;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #a8531a;
    letter-spacing: .3px;
    background: #fef4e6;
    border-bottom: 1px dashed #f0d9bb;
}

/* ------------------------------------------------------------- 提示条 */

.tip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    background: #fff8e6;
    border: 1px dashed #e0b96a;
    font-size: 12.5px;
    color: #8a6320;
}
.tip strong { font-size: 13px; font-weight: 700; }
.tip span { color: #a8894a; font-size: 11.5px; }

/* ------------------------------------------------------------- 底部 */

.ft {
    padding: 4px 16px 16px;
    text-align: center;
    font-size: 11.5px;
    color: var(--ink-3);
    line-height: 1.7;
}
.ft p { margin: 3px 0; }
.ft-contact { color: #8a6320; font-weight: 600; font-size: 13px; }
.ft-contact a { color: #8a6320; }
.ft-sub { font-size: 10.5px; color: #b0a894; }

/* ------------------------------------------------------------- 导航 */

.nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 520px;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line-strong);
    z-index: 30;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 11px;
    color: var(--ink-3);
    cursor: pointer;
    transition: color .2s;
}
.nav-item .nav-ico { font-size: 17px; line-height: 1; }
.nav-item.active { color: var(--gold-2); font-weight: 700; }

/* ------------------------------------------------------------- 弹层 */

.sheet {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
/* 作者样式里的 display 会盖掉 hidden 属性的 display:none，这里必须显式关掉，
   否则遮罩会常驻在页面上、把底部导航的点击全部吃掉 */
.sheet[hidden] { display: none; }
.sheet-mask { position: absolute; inset: 0; background: rgba(30, 22, 10, .45); }

.sheet-body {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    animation: slideUp .22s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(24px); opacity: .6; }
    to   { transform: translateY(0); opacity: 1; }
}
.sheet-body h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #7a4a12;
}
.sheet-body .row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f1e9da;
    font-size: 14px;
}
.sheet-body .row:last-of-type { border-bottom: 0; }
.sheet-body .row dt { color: var(--ink-3); margin: 0; }
.sheet-body .row dd { margin: 0; font-weight: 600; text-align: right; word-break: break-all; }
.sheet-body .row dd a { color: #0f5c9c; text-decoration: none; }

/* 联系方式面板里的电话号：做成醒目的「点击拨打」入口 */
.sheet-body .row dd a.tel {
    display: inline-block;
    color: #0f5c9c;
    padding: 6px 14px;
    border-radius: 18px;
    border: 1px solid #b9d3ec;
    background: #eef6ff;
    font-weight: 700;
    font-size: 16px;
}

.sheet-close {
    width: 100%;
    margin-top: 14px;
    padding: 11px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gold-2), var(--gold-1));
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* 小屏微调 */
@media (max-width: 340px) {
    .tbl td { font-size: 15px; height: 44px; }
    .name-cell { font-size: 14px; }
    .hd-title h1 { font-size: 15.5px; }
}

/* 桌面打开时给个手机边框观感 */
@media (min-width: 560px) {
    body { background: #e8dfd0; }
    .phone {
        box-shadow: 0 0 0 1px rgba(122, 74, 18, .12), 0 10px 40px rgba(122, 74, 18, .16);
        min-height: 100vh;
    }
}
