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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

body:has(.card) {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ---- 客户兑换页 ---- */

.card {
    background: #fff;
    border-radius: 12px;
    padding: 48px 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.card h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 28px;
}

.card input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.card input[type="email"]:focus {
    border-color: #4285f4;
}

.card input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    margin-top: 12px;
}

.card input[type="text"]:focus {
    border-color: #4285f4;
}

.input-hint {
    font-size: 12px;
    color: #999;
    text-align: left;
    margin-top: 6px;
    line-height: 1.4;
}

.card input.error {
    border-color: #e74c3c;
}

.card button {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: #4285f4;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.card button:hover {
    background: #3367d6;
}

.card button:disabled {
    background: #a4c4f4;
    cursor: not-allowed;
}

.success-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    border: 2px solid #27ae60;
    border-radius: 8px;
    background: #eafaf1;
    font-size: 15px;
    color: #27ae60;
}

.checkmark {
    font-size: 22px;
    font-weight: bold;
}

.hint {
    margin-top: 16px;
    font-size: 13px;
    color: #888;
    line-height: 1.6;
}

.expired {
    color: #999;
    font-size: 15px;
    padding: 20px 0;
}

.card-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 28px 0 20px;
}

.query-section {
    text-align: left;
}

.query-title {
    font-size: 14px;
    color: #888;
    margin-bottom: 12px;
}

.query-section input[type="text"] {
    margin-top: 0;
}

.btn-query {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-query:hover {
    background: #eee;
}

#query-result {
    margin-top: 16px;
}

/* ---- 账户详情卡片 ---- */

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-export {
    padding: 3px 12px;
    background: #4285f4;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-export:hover {
    background: #3367d6;
}

.export-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.info-box {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    text-align: left;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-label {
    color: #888;
}

/* ---- 管理页面 ---- */

.admin-container {
    width: 900px;
    max-width: 95vw;
    margin: 40px auto;
    padding: 0 20px;
}

.admin-container h1 {
    font-size: 22px;
    margin-bottom: 24px;
}

.generate-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.generate-section label {
    font-size: 14px;
}

.generate-section input {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.generate-section button {
    padding: 8px 20px;
    background: #4285f4;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.generate-section button:hover {
    background: #3367d6;
}

.section {
    margin-bottom: 28px;
}

.section h2 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #555;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

th, td {
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
}

td button {
    padding: 4px 14px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

td button:hover {
    background: #219a52;
}

.link-text {
    font-size: 13px;
    color: #4285f4;
    word-break: break-all;
}

.copy-btn {
    margin-left: 8px;
    padding: 2px 10px !important;
    background: #eee !important;
    color: #333 !important;
    font-size: 12px !important;
}

.copy-btn:hover {
    background: #ddd !important;
}

.empty {
    text-align: center;
    color: #bbb;
    padding: 16px !important;
}

.generate-section input[type="email"] {
    width: 200px;
    text-align: left;
}

.generate-section input[type="date"] {
    width: 140px;
    text-align: center;
}

.divider {
    border: none;
    border-top: 1px solid #ddd;
    margin: 40px 0 24px;
}

.warning-section {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 16px;
}

.warning-section h2 {
    color: #e65100 !important;
}

.row-warning {
    background: #fff8e1 !important;
}

.text-danger {
    color: #e74c3c;
    font-weight: 600;
}

.btn-danger {
    background: #e74c3c !important;
    color: #fff !important;
}

.btn-danger:hover {
    background: #c0392b !important;
}

.btn-cancel {
    background: #eee;
    color: #333;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #ddd;
}

/* ---- 弹窗 ---- */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    width: 420px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer button {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: #4285f4;
    color: #fff;
}

.modal-footer button:hover {
    background: #3367d6;
}

.radio-row {
    display: block;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
}

.radio-row:hover {
    background: #f5f5f5;
}

.radio-row input {
    margin-right: 8px;
}

.radio-hint {
    color: #999;
    font-size: 12px;
}

.client-list {
    list-style: none;
    padding: 0;
}

.client-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

td a {
    color: #4285f4;
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

.badge {
    display: inline-block;
    background: #e0e0e0;
    color: #666;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ---- 导航标签页 ---- */

.nav-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    padding: 10px 28px;
    font-size: 15px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
    color: #333;
}

.tab.active {
    color: #4285f4;
    border-bottom-color: #4285f4;
    font-weight: 600;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #4285f4;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* ---- 已发货标记 ---- */

.row-shipped {
    background-color: #fffbeb !important;
}

.badge-shipped {
    display: inline-block;
    background: #f39c12;
    color: #fff;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

.btn-secondary {
    background: #95a5a6 !important;
    color: #fff !important;
}

.btn-secondary:hover {
    background: #7f8c8d !important;
}

/* ---- 表格滚动容器 ---- */

.table-wrap {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.table-wrap > table {
    box-shadow: none;
    border-radius: 0;
}

.table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fafafa;
}
