/**
 * 个人标签引导页 - 通用组件样式
 *
 * @description 按钮、卡片、输入框、主题切换等通用组件
 */

/* ==================== 主题切换按钮 ==================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--accent);
    transform: scale(1.05);
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .theme-toggle:hover {
    background: var(--accent);
    color: white;
}

/* ==================== 通用按钮 ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover { background: var(--accent); color: white; }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-block { width: 100%; }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* ==================== 通用输入框 ==================== */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="time"],
select,
textarea {
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
}

/* ==================== 复选框 ==================== */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ==================== 滑块 ==================== */
input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== 定位通知 ==================== */
.location-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(100%);
}

.location-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.location-toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.location-toast-icon {
    color: var(--accent);
    font-size: 1.1rem;
}

.location-toast span {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* ==================== 广告区域 ==================== */
.ad-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ==================== 代码块 ==================== */
code {
    font-family: 'SF Mono', Monaco, monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: var(--accent);
}

/* ==================== 认证页面 ==================== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

/* 浅色模式下增强auth-card对比度 */
[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
}

.auth-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.btn-full {
    width: 100%;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-links a {
    color: var(--accent);
    text-decoration: none;
}

/* 浅色模式下的认证页面 */
[data-theme="light"] .auth-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ==================== 页面标题 ==================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    color: var(--accent);
}

/* ==================== 通用工具类 ==================== */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-gap-1 {
    display: flex;
    gap: 1rem;
}

.flex-gap-2 {
    display: flex;
    gap: 2rem;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 600;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }