/* 
 * TeeTimeVN - 高端高尔夫记分卡
 * 基础样式 - 深色主题 + 金/绿点缀
 */

/* ========== CSS 变量 ========== */
:root {
    /* 主色调 - 深邃绿 */
    --color-primary: #1a5f3b;
    --color-primary-light: #2a7f5b;
    --color-primary-dark: #0d4028;

    /* 点缀色 - 奢华金 */
    --color-accent: #d4af37;
    --color-accent-light: #f0d77a;
    --color-accent-dark: #a68a2b;

    /* 深色背景 */
    --color-bg-dark: #0a0f0c;
    --color-bg-card: #121a15;
    --color-bg-elevated: #1a2520;
    --color-bg-input: #0d1410;

    /* 文字颜色 */
    --color-text-primary: #f5f5f0;
    --color-text-secondary: #a8b5a0;
    --color-text-muted: #6b7a65;

    /* 状态颜色 */
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-error: #f87171;
    --color-info: #60a5fa;

    /* 记分卡颜色 */
    --color-birdie: #22c55e;
    /* 小鸟 - 绿色 */
    --color-eagle: #eab308;
    /* 老鹰 - 金色 */
    --color-bogey: #f97316;
    /* 柏忌 - 橙色 */
    --color-double-bogey: #ef4444;
    /* 双柏忌 - 红色 */

    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    --gradient-accent: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f0d77a 50%, #d4af37 100%);

    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.3);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* 字体 */
    --font-primary: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', 'SF Pro Display', -apple-system, sans-serif;

    /* 过渡 */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* 安全区域 */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== 重置样式 ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--color-bg-dark);
    color: var(--color-text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* 禁用 iOS 缩放 */
input,
select,
textarea {
    font-size: 16px;
}

/* ========== 版式 ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text-primary);
}

h1 {
    font-size: 2rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-light);
}

/* ========== 布局 ========== */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: var(--safe-area-top);
    padding-bottom: calc(var(--safe-area-bottom) + 1rem);
}

/* 导航条 - 紧凑型 */
.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 15, 12, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    height: 44px;
    padding: 0 0.75rem;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-link .logo-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    /* 增大间距，方便手机点击 */
}

.header-icon {
    font-size: 1.2rem;
    padding: 0.5rem;
    /* 增大点击区域 */
    min-width: 44px;
    /* iOS 推荐最小点击区域 */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-link {
    font-size: 0.875rem;
    color: var(--color-accent);
    padding: 0.25rem 0.5rem;
}

.avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 语言切换器 */
.lang-switcher {
    position: relative;
}

.lang-btn {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    border-color: var(--color-accent);
    background: rgba(212, 175, 55, 0.1);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--color-bg-elevated);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.lang-option:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--color-text-primary);
}

.lang-option.active {
    color: var(--color-accent);
    background: rgba(212, 175, 55, 0.15);
}

.page-content {
    padding: 1.5rem 1rem;
}

/* ========== 卡片 ========== */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(212, 175, 55, 0.1);
    padding: 1.25rem;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-premium {
    background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-elevated) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--color-primary-light);
    box-shadow: var(--shadow-lg);
}

.btn-accent {
    background: var(--gradient-accent);
    color: var(--color-bg-dark);
    box-shadow: var(--shadow-glow);
}

.btn-accent:hover {
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

.btn-outline:hover {
    background: rgba(212, 175, 55, 0.1);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text-primary);
    background: var(--color-bg-input);
    border: 2px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

/* 搜索框 */
.search-box {
    position: relative;
    width: 100%;
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 1.25rem;
}

.search-box .form-input {
    padding-left: 3rem;
    font-size: 1.125rem;
}

/* ========== 头像 ========== */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 1.125rem;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

/* 头像组 */
.avatar-group {
    display: flex;
    gap: -8px;
}

.avatar-group .avatar {
    margin-left: -8px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ========== Bottom Sheet ========== */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-bg-elevated);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding: 1rem;
    padding-bottom: calc(var(--safe-area-bottom) + 1rem);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--color-text-muted);
    border-radius: var(--radius-full);
    margin: 0 auto 1rem;
}

.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========== Toast 通知 ========== */
.toast {
    position: fixed;
    top: calc(var(--safe-area-top) + 1rem);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 2000;
    background: var(--color-bg-elevated);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-normal);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    border-left: 3px solid var(--color-success);
}

.toast-error {
    border-left: 3px solid var(--color-error);
}

.toast-warning {
    border-left: 3px solid var(--color-warning);
}

.toast-info {
    border-left: 3px solid var(--color-info);
}

/* ========== Logo ========== */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== 语言切换 ========== */
.locale-switcher {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.locale-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.locale-btn:hover {
    color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.locale-btn.active {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(212, 175, 55, 0.1);
}

/* ========== 加载动画 ========== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 12, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease;
}

.animate-slide-up {
    animation: slideUp var(--transition-normal) ease;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg,
            var(--color-bg-elevated) 25%,
            var(--color-bg-card) 50%,
            var(--color-bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ========== 工具类 ========== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-accent {
    color: var(--color-accent);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-success {
    color: var(--color-success);
}

.text-error {
    color: var(--color-error);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========== 响应式设计 - 平板 (768px+) ========== */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 2rem;
    }

    .page-content {
        padding: 2rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* 卡片网格 */
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    /* 表单 */
    .form-input,
    .form-select {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }

    /* 按钮 */
    .btn {
        padding: 1rem 2rem;
    }

    .btn-lg {
        padding: 1.25rem 2.5rem;
        font-size: 1.125rem;
    }

    /* Auth 页面 */
    .auth-page {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }

    .auth-card {
        max-width: 420px;
        margin: 2rem auto;
        padding: 2.5rem;
    }
}

/* ========== 响应式设计 - 桌面 (1024px+) ========== */
@media (min-width: 1024px) {
    .container {
        max-width: 960px;
        padding: 0 2.5rem;
    }

    .page-header {
        padding: 1.25rem 2rem;
    }

    .page-content {
        padding: 2.5rem 2rem;
    }

    /* 两栏布局容器 */
    .desktop-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 2rem;
        min-height: 100vh;
    }

    .desktop-sidebar {
        background: var(--color-bg-card);
        border-right: 1px solid rgba(212, 175, 55, 0.1);
        padding: 2rem;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    .desktop-main {
        padding: 2rem;
    }

    /* 更大的卡片 */
    .card {
        padding: 1.75rem;
    }

    .card-lg {
        padding: 2rem 2.5rem;
    }

    /* 网格布局 */
    .grid-cols-md-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-cols-md-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    /* 搜索框 - 保持全宽 */
    .search-box {
        max-width: 100%;
    }

    /* 球场网格 */
    .club-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Auth 页面 - 两栏 */
    .auth-page {
        background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-card) 100%);
    }

    .auth-card {
        max-width: 480px;
        box-shadow: var(--shadow-lg);
    }
}

/* ========== 响应式设计 - 大屏桌面 (1280px+) ========== */
@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }

    .desktop-layout {
        grid-template-columns: 300px 1fr;
    }

    /* 大屏网格 */
    .grid-cols-lg-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-cols-lg-5 {
        grid-template-columns: repeat(5, 1fr);
    }

    .grid-cols-lg-6 {
        grid-template-columns: repeat(6, 1fr);
    }

    /* 球场网格 */
    .club-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== 响应式设计 - 超大屏 (1536px+) ========== */
@media (min-width: 1536px) {
    .container {
        max-width: 1400px;
    }

    .desktop-layout {
        grid-template-columns: 320px 1fr;
        gap: 3rem;
    }
}

/* ========== 桌面端悬停效果增强 ========== */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .btn:hover {
        transform: translateY(-1px);
    }

    .club-card:hover {
        border-color: var(--color-accent);
        transform: translateY(-4px);
        box-shadow: var(--shadow-glow);
    }

    .search-result-item:hover {
        background: rgba(212, 175, 55, 0.15);
    }
}

/* ========== 桌面端专属工具类 ========== */
@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* 居中容器 - 桌面端 */
.desktop-center {
    margin: 0 auto;
}

@media (min-width: 768px) {
    .desktop-center {
        max-width: 600px;
    }
}

@media (min-width: 1024px) {
    .desktop-center {
        max-width: 800px;
    }
}