/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f4f4f6;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

input, button {
    outline: none;
    border: none;
    font-family: inherit;
}

ul, li {
    list-style: none;
}

/* 主题色变量 */
:root {
    --theme: #252525;
    --theme-light: #3a3a3a;
    --gold: #d4a548;
    --gold-light: #e6c074;
    --up: #e64545;
    --down: #22a06b;
    --border: #e8e8e8;
    --text: #333;
    --text-sub: #999;
    --bg: #f4f4f6;
    --card: #ffffff;
}

body {
    padding-bottom: 60px;
}

/* ========== 顶部头部 ========== */
.header {
    background: linear-gradient(135deg, #252525 0%, #3a3a3a 100%);
    padding: 14px 16px 12px;
    color: #fff;
    position: relative;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, #d4a548, #e6c074);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #252525;
    box-shadow: 0 2px 6px rgba(212,165,72,0.4);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 1px;
}

.logo-text .sub {
    font-size: 11px;
    color: #d4a548;
    margin-top: 2px;
}

/* 滚动消息条 */
.notice-bar {
    margin-top: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 0 12px;
    height: 32px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.notice-icon {
    flex: none;
    width: 18px;
    height: 18px;
    background: var(--gold);
    border-radius: 50%;
    color: #252525;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.notice-content {
    flex: 1;
    overflow: hidden;
    height: 32px;
    line-height: 32px;
}

.notice-list {
    display: inline-block;
    white-space: nowrap;
    animation: scrollNotice 30s linear infinite;
}

.notice-list span {
    display: inline-block;
    padding-right: 60px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
}

@keyframes scrollNotice {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 时间和开盘状态 */
.market-info {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.market-time {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-family: "Helvetica Neue", monospace;
}

.market-status {
    background: var(--down);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.market-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: pulse 1.5s infinite;
}

.market-status.closed {
    background: #888;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========== 价格表 ========== */
.price-section {
    background: #fff;
    margin: 12px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.section-title {
    padding: 14px 14px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.section-title .title {
    font-size: 15px;
    font-weight: bold;
    color: var(--theme);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title .title::before {
    content: "";
    width: 3px;
    height: 14px;
    background: var(--gold);
    border-radius: 2px;
}

.section-title .more {
    font-size: 12px;
    color: var(--text-sub);
}

.price-table {
    width: 100%;
}

.price-thead {
    display: flex;
    background: #fafafa;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-sub);
    font-weight: normal;
    border-bottom: 1px solid var(--border);
}

.price-thead .col,
.price-row .col {
    flex: 1;
    text-align: center;
}

.price-thead .col-name,
.price-row .col-name {
    flex: 1.1;
    text-align: left;
}

.price-thead .col-action,
.price-row .col-action {
    flex: 1.2;
}

.price-row {
    display: flex;
    align-items: center;
    padding: 14px 12px;
    border-bottom: 1px solid #f3f3f3;
    font-size: 14px;
}

.price-row:last-child {
    border-bottom: none;
}

.metal-name {
    display: flex;
    flex-direction: column;
}

.metal-name .name {
    font-size: 15px;
    font-weight: bold;
    color: var(--theme);
}

.metal-name .unit {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 2px;
}

.price-num {
    font-size: 15px;
    font-weight: bold;
    font-family: "Helvetica Neue", monospace;
}

.price-num.up {
    color: var(--up);
}

.price-num.down {
    color: var(--down);
}

.price-num .arrow {
    font-size: 10px;
    margin-left: 1px;
}

.high-low {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    line-height: 1.6;
}

.high-low .high {
    color: var(--up);
}

.high-low .low {
    color: var(--down);
}

.btn-pricing {
    background: linear-gradient(135deg, #d4a548, #e6c074);
    color: #252525;
    padding: 7px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(212,165,72,0.35);
    cursor: pointer;
}

.btn-pricing:active {
    transform: scale(0.96);
}

/* ========== 消息框 ========== */
.contact-box {
    margin: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-info .shop-name {
    font-size: 15px;
    font-weight: bold;
    color: var(--theme);
    margin-bottom: 8px;
}

.contact-info .item {
    font-size: 12px;
    color: #666;
    line-height: 1.8;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.contact-info .item .label {
    color: var(--text-sub);
    flex: none;
}

.contact-qrcode {
    flex: none;
    width: 88px;
    height: 88px;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-qrcode img,
.contact-qrcode canvas {
    width: 100%;
    height: 100%;
}

/* ========== 底部导航 ========== */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.tabbar-item {
    flex: 1;
    text-align: center;
    padding: 8px 0 10px;
    color: var(--text-sub);
    font-size: 12px;
    cursor: pointer;
}

.tabbar-item .icon {
    font-size: 22px;
    margin-bottom: 2px;
    display: block;
    line-height: 1;
}

.tabbar-item.active {
    color: var(--gold);
}

/* ========== 弹窗 ========== */
.mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
}

.mask.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.modal-head {
    background: linear-gradient(135deg, #252525, #3a3a3a);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-head .title {
    font-size: 16px;
    font-weight: bold;
}

.modal-head .close {
    font-size: 22px;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    line-height: 1;
}

.modal-body {
    padding: 16px 18px 8px;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 14px;
}

.form-row:last-child {
    border-bottom: none;
}

.form-row .label {
    flex: 0 0 80px;
    color: var(--text-sub);
    font-size: 13px;
}

.form-row .value {
    flex: 1;
    text-align: right;
    color: var(--theme);
    font-size: 15px;
    font-weight: bold;
}

.form-row .value.gold {
    color: var(--gold);
}

.form-row input[type="text"],
.form-row input[type="number"] {
    flex: 1;
    text-align: right;
    background: transparent;
    font-size: 15px;
    color: var(--theme);
    font-weight: bold;
}

.form-row input::placeholder {
    color: #ccc;
    font-weight: normal;
    font-size: 14px;
}

.agree-row {
    display: flex;
    align-items: center;
    padding: 4px 0 16px;
    font-size: 12px;
    color: var(--text-sub);
}

.checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    cursor: pointer;
}

.checkbox.checked {
    background: var(--gold);
    border-color: var(--gold);
}

.checkbox.checked::after {
    content: "✓";
    color: #fff;
    font-size: 11px;
    font-weight: bold;
}

.agree-row a {
    color: var(--gold);
}

.modal-foot {
    display: flex;
    border-top: 1px solid var(--border);
}

.modal-btn {
    flex: 1;
    padding: 14px 0;
    text-align: center;
    font-size: 15px;
    cursor: pointer;
    background: #fff;
}

.modal-btn.cancel {
    color: var(--text-sub);
    border-right: 1px solid var(--border);
}

.modal-btn.confirm {
    color: #252525;
    background: linear-gradient(135deg, #d4a548, #e6c074);
    font-weight: bold;
}

/* 成功弹窗 */
.success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4a548, #e6c074);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 18px auto 10px;
    font-size: 30px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(212,165,72,0.4);
}

.success-title {
    text-align: center;
    font-size: 17px;
    font-weight: bold;
    color: var(--theme);
    margin-bottom: 6px;
}

.success-tip {
    text-align: center;
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 14px;
}

.detail-list {
    background: #fafafa;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 4px 16px;
}

.detail-list .item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
}

.detail-list .item .lbl {
    color: var(--text-sub);
}

.detail-list .item .val {
    color: var(--theme);
    font-weight: bold;
}

/* ========== 二级页面通用 ========== */
.page-header {
    background: linear-gradient(135deg, #252525, #3a3a3a);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-header .back {
    font-size: 22px;
    margin-right: 10px;
    cursor: pointer;
    line-height: 1;
}

.page-header .title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-right: 32px;
}

/* ========== 订单页 ========== */
.order-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 50px;
    z-index: 9;
}

.order-tabs .tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    color: var(--text-sub);
    cursor: pointer;
    position: relative;
}

.order-tabs .tab.active {
    color: var(--theme);
    font-weight: bold;
}

.order-tabs .tab.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
}

.order-list {
    padding: 12px;
}

.order-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.order-card .order-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.order-card .order-time {
    font-size: 12px;
    color: var(--text-sub);
}

.order-card .order-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.order-status.priced {
    background: rgba(212,165,72,0.15);
    color: var(--gold);
}

.order-status.done {
    background: rgba(34,160,107,0.12);
    color: var(--down);
}

.order-status.expired {
    background: #f3f3f3;
    color: #999;
}

.order-card .order-mid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 10px;
}

.order-card .metal-info {
    display: flex;
    flex-direction: column;
}

.order-card .metal-info .m-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--theme);
}

.order-card .metal-info .m-gram {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 4px;
}

.order-card .order-price {
    text-align: right;
}

.order-card .order-price .p-num {
    font-size: 17px;
    font-weight: bold;
    color: var(--up);
    font-family: "Helvetica Neue", monospace;
}

.order-card .order-price .p-lbl {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 2px;
}

.order-card .order-bot {
    padding-top: 10px;
    border-top: 1px dashed #eee;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.order-card .order-bot .name {
    font-weight: bold;
    color: var(--theme);
}

.empty-tip {
    text-align: center;
    padding: 80px 0;
    color: var(--text-sub);
    font-size: 13px;
}

/* ========== 登录页 ========== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #252525 0%, #3a3a3a 50%, #f4f4f6 50%, #f4f4f6 100%);
    padding: 0 24px;
}

.login-logo {
    text-align: center;
    padding: 60px 0 40px;
}

.login-logo .l-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #d4a548, #e6c074);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: #252525;
    box-shadow: 0 4px 14px rgba(212,165,72,0.45);
}

.login-logo .l-name {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 2px;
}

.login-logo .l-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

.login-form {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.login-form .form-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--theme);
    margin-bottom: 20px;
    text-align: center;
}

.input-group {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 46px;
    transition: border-color 0.2s;
}

.input-group:focus-within {
    border-color: var(--gold);
}

.input-group .ig-icon {
    width: 22px;
    color: var(--text-sub);
    font-size: 16px;
    margin-right: 8px;
    text-align: center;
}

.input-group input {
    flex: 1;
    height: 100%;
    background: transparent;
    font-size: 14px;
    color: var(--theme);
}

.input-group .toggle {
    color: var(--text-sub);
    font-size: 18px;
    padding: 0 4px;
    cursor: pointer;
}

.login-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 20px;
    font-size: 12px;
}

.login-tools .left {
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.login-tools .right {
    color: var(--gold);
}

.login-btn {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, #252525, #3a3a3a);
    color: var(--gold);
    border-radius: 23px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 4px;
    cursor: pointer;
}

.login-btn:active {
    opacity: 0.85;
}

.login-tip {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-sub);
}

.login-tip a {
    color: var(--gold);
}

/* ========== 用户协议页 ========== */
.agreement-content {
    background: #fff;
    margin: 12px;
    padding: 18px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.agreement-content h2 {
    font-size: 18px;
    color: var(--theme);
    margin-bottom: 12px;
    text-align: center;
}

.agreement-content .meta {
    font-size: 12px;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.agreement-content h3 {
    font-size: 15px;
    color: var(--theme);
    margin: 16px 0 8px;
    padding-left: 10px;
    border-left: 3px solid var(--gold);
}

.agreement-content p {
    font-size: 13px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 8px;
    text-indent: 2em;
}
