/* ============================================================
   LuckyGo · Apple Minimal (Refined)
   ------------------------------------------------------------
   设计原则：
   1) 留白优先，弱化装饰
   2) 单一主色（系统蓝），其余使用中性灰阶
   3) 阴影极轻，避免塑料感与多层光泽
   4) 字体层级清晰，依靠字重 + 字号 + 颜色区分
   ============================================================ */

:root {
    --color-bg: #f5f5f7;
    --color-surface: #ffffff;
    --color-surface-2: #fafafc;
    --color-border: #e5e5ea;
    --color-divider: #efeff2;
    --color-hairline: rgba(60, 60, 67, 0.12);

    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-text-tertiary: #8e8e93;
    --color-text-quaternary: #aeaeb2;

    --color-primary: #0071e3;
    --color-primary-hover: #0077ed;
    --color-primary-active: #006edb;
    --color-primary-soft: rgba(0, 113, 227, 0.08);

    --color-success: #30b760;
    --color-success-soft: rgba(48, 183, 96, 0.12);
    --color-warning: #ff9f0a;
    --color-warning-soft: rgba(255, 159, 10, 0.14);
    --color-danger: #ff3b30;
    --color-danger-soft: rgba(255, 59, 48, 0.10);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);

    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display",
        "SF Pro Text", "Helvetica Neue", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-stack);
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    letter-spacing: -0.01em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

a:hover { opacity: 0.75; }

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

/* ============================================================
   Auth Pages（登录 / 注册）
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: var(--color-bg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.auth-logo {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.85rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--color-text);
}

.auth-header p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-top: 0.4rem;
}

.auth-form {
    width: 100%;
    max-width: 380px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-divider);
}

.form-error {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1.1rem;
    line-height: 1.45;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group:last-of-type {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    outline: none;
    background: var(--color-surface);
    color: var(--color-text);
}

.form-group input::placeholder {
    color: var(--color-text-quaternary);
}

.form-group input:hover {
    border-color: #d8d8dc;
}

.form-group input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.06s ease;
    text-align: center;
    letter-spacing: -0.005em;
}

.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { background: var(--color-primary-active); transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-footer a {
    color: var(--color-primary);
    font-size: 0.9rem;
}

/* ============================================================
   通用页面骨架（我的奖品等）
   ============================================================ */
.page {
    min-height: 100vh;
    background: var(--color-bg);
    padding-bottom: 2rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-hairline);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-header h1 {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.back-btn {
    font-size: 1.5rem;
    color: var(--color-primary);
    padding: 0.2rem 0.5rem;
    line-height: 1;
    font-weight: 400;
}

/* ============================================================
   抽奖记录列表 / 我的奖品
   ============================================================ */
.records-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 540px;
    margin: 0 auto;
}

.record-card {
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    border: 1px solid var(--color-divider);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-width: 0;
}

.record-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.record-icon {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-divider);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-right: 0.85rem;
    flex-shrink: 0;
    overflow: hidden;
    color: var(--color-text-tertiary);
}

.record-card.won .record-icon {
    background: var(--color-warning-soft);
    border-color: rgba(255, 159, 10, 0.25);
    color: var(--color-warning);
}

.record-icon img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

.record-info {
    flex: 1;
    min-width: 0;
}

.record-title {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-card.lost .record-title {
    color: var(--color-text-secondary);
}

.record-meta {
    font-size: 0.78rem;
    color: var(--color-text-tertiary);
}

.record-badge {
    background: transparent;
    color: var(--color-warning);
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    flex-shrink: 0;
    font-weight: 600;
    border: 1px solid rgba(255, 159, 10, 0.4);
    background: var(--color-warning-soft);
}

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 1rem 3rem;
    color: var(--color-text-tertiary);
}

.empty-icon {
    font-size: 2.6rem;
    margin-bottom: 0.6rem;
    opacity: 0.55;
}

.empty-state p {
    font-size: 0.92rem;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(28, 28, 30, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    padding: 0.8rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    z-index: 9999;
    animation: fadeInOut 2s ease;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

@keyframes fadeInOut {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
    15%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    85%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ============================================================
   Utilities
   ============================================================ */
.text-muted { color: var(--color-text-tertiary); font-size: 0.8rem; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
}

.badge-success { background: var(--color-success-soft); color: #1c7c33; }
.badge-danger  { background: var(--color-danger-soft);  color: #c93128; }
.badge-warning { background: var(--color-warning-soft); color: #a35d00; }
.badge-info    { background: var(--color-primary-soft); color: var(--color-primary); }
