/* ========== CSS Variables ========== */
:root {
    --primary: #176b6a;
    --primary-light: #318886;
    --primary-dark: #0f5353;
    --secondary: #b7832f;
    --accent: #d7b15c;
    --bg: #f2f6f5;
    --card-bg: #ffffff;
    --text: #1d3032;
    --text-light: #647476;
    --text-muted: #8b999a;
    --border: #dbe5e3;
    --success: #27806d;
    --warning: #bd842b;
    --danger: #c75454;
    --shadow: 0 2px 12px rgba(19,80,80,0.08);
    --shadow-lg: 0 8px 24px rgba(19,80,80,0.13);
    --radius: 12px;
    --radius-sm: 8px;
    --tab-height: 65px;
    --header-height: 50px;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

html, body {
    height: 100%;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 750px;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
}

/* WeChat's WebView can reveal the document background below short page content. */
html.wechat-browser, body.wechat-browser, body.wechat-browser #app, body.wechat-browser .main-content {
    background: #343434;
}

/* ========== Top Header ========== */
.top-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    height: var(--header-height);
    background: linear-gradient(135deg, #FFCA5C, #FFD580, #FFF3D0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(255,69,124,0.1);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.brand-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    letter-spacing: 2px;
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    margin-top: 0;
    margin-bottom: var(--tab-height);
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== Tab Bar ========== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    height: var(--tab-height);
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 100;
    border-top: 1px solid var(--border);
    padding-bottom: 8px;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    padding: 6px 12px;
    transition: all 0.3s;
    position: relative;
}

.tab-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.tab-item.active {
    color: var(--primary);
}

.tab-item.active i {
    transform: scale(1.1);
}

/* Center Tab */
.center-tab {
    position: relative;
    top: -10px;
}

.center-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #666, #333);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.center-btn i {
    color: #fff;
    font-size: 20px;
}

.center-tab span {
    margin-top: 4px;
}

/* Badge */
.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--bg);
}

.modal-body {
    padding: 20px;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== Utility Classes ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,69,124,0.3);
}

.btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255,69,124,0.2);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ========== Form Elements ========== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,69,124,0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23636e72' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ========== Card ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ========== Empty State ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}
.native-pay-qrcode {
    display: block;
    width: 240px;
    height: 240px;
    margin: 0 auto 18px;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}
