/* =====================================================
   Joey虾虾网站 - 专业简洁风格
   配色: 白色底色 + 渐变功能块 + 毛玻璃效果
   ===================================================== */

:root {
    /* 主色调 */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    
    /* 功能颜色 */
    --color-morning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --color-evening: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --color-sector: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --color-coming: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    
    /* 中性色 */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 状态色 */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--white);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    text-align: center;
    padding-top: 64px;
}

/* 所有容器居中 */
.container, .card, .form-container, .profile-container, .feature-grid, .feature-list,
.messages-container, .stocks-container, .login-container, .register-container {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.container, .page-container, .messages-container, .stocks-container, .login-container, .register-container,
.form-container, .profile-container {
    padding-top: 56px;
}

/* 表单元素恢复左对齐（保持可读性） */
.form-group, .form-group label, .form-group .form-label,
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
textarea, select, .form-input {
    text-align: left;
}

/* 表格恢复左对齐 */
table, th, td, .data-table, .admin-table {
    text-align: left;
}

/* 按钮和徽章保持居中 */
.btn, .badge, .feature-badge, .feature-item-status, .perm-tag {
    text-align: center;
}

/* ===================== 导航栏 ===================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.navbar-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--gray-900);
}

.navbar-brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
}

.navbar-brand span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-links a {
    color: var(--gray-600);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.navbar-links a:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.navbar-links a.active {
    background: var(--primary);
    color: var(--white);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px 6px 6px;
    border-radius: var(--radius-full);
    transition: background 0.2s;
}

.navbar-user-info:hover {
    background: var(--gray-100);
}

.navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--gray-200);
}

.navbar-username {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

/* ===================== 主容器 ===================== */

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 88px 24px 40px;
}

.page-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ===================== 卡片 ===================== */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===================== 功能方块 ===================== */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.feature-card {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.08);
    opacity: 1;
    transition: opacity 0.3s;
    z-index: 1;
}

.feature-card:hover::before {
    opacity: 0;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* 所有子元素需在遮罩层之上 */
.feature-card > * {
    position: relative;
    z-index: 2;
}

/* 功能卡片颜色 */
.feature-card.morning,
.feature-card.daily-report {
    background: var(--color-morning);
    color: white;
}

.feature-card.evening {
    background: var(--color-evening);
    color: white;
}

.feature-card.sector,
.feature-card.sector-prediction {
    background: var(--color-sector);
    color: white;
}

.feature-card.feedback {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.feature-card.coming {
    background: var(--color-coming);
    color: white;
    cursor: default;
}

.feature-card.disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
}

.feature-card.disabled::before {
    opacity: 1;
    background: rgba(255, 255, 255, 0.5);
}

.feature-icon {
    position: relative;
    z-index: 2;
    font-size: 36px;
    margin-bottom: 16px;
}

.feature-title {
    position: relative;
    z-index: 2;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-desc {
    position: relative;
    z-index: 2;
    font-size: 13px;
    opacity: 0.9;
}

.feature-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================== 表单 ===================== */

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--gray-900);
    background: var(--white);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
}

/* ===================== 按钮 ===================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ===================== 消息提示 ===================== */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ===================== 头像 ===================== */

.avatar-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.avatar-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    overflow: hidden;
    background: var(--gray-100);
}

.avatar-option:hover {
    border-color: var(--gray-300);
    transform: scale(1.05);
}

.avatar-option.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===================== 页脚 ===================== */

.footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--gray-500);
    font-size: 13px;
    border-top: 1px solid var(--gray-100);
    margin-top: 40px;
}

.footer a {
    color: var(--gray-600);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer-beian {
    margin-top: 8px;
}

/* ===================== 返回按钮 ===================== */

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-button:hover {
    color: var(--primary);
}

/* ===================== 开关 ===================== */

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: var(--success);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: var(--radius-full);
    transition: transform 0.3s;
    box-shadow: var(--shadow);
}

.toggle-switch.active::after {
    transform: translateX(22px);
}

/* ===================== 响应式 ===================== */

@media (max-width: 768px) {
    .navbar-links {
        display: none;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .main-container {
        padding: 80px 16px 24px;
    }
    
    .card {
        padding: 24px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .avatar-selector {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===================== 动画 ===================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .feature-card {
    animation: fadeIn 0.3s ease-out;
}

.feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.15s; }
.feature-card:nth-child(4) { animation-delay: 0.2s; }

/* ===================== 毛玻璃效果 ===================== */

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===================== 加载状态 ===================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================== 空状态 ===================== */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ===================== 用户功能列表 ===================== */

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
}

.feature-item.disabled {
    opacity: 0.5;
    background: var(--gray-100);
}

.feature-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-item-icon {
    font-size: 24px;
}

.feature-item-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.feature-item-content p {
    font-size: 13px;
    color: var(--gray-500);
}

.feature-item-status {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.feature-item-status.enabled {
    background: #d1fae5;
    color: #065f46;
}

.feature-item-status.disabled {
    background: var(--gray-200);
    color: var(--gray-500);
}

.feature-item-status.locked {
    background: #fef3c7;
    color: #92400e;
}
