/* 全局公共样式文件 - 统一高端UI风格 */

:root {
    /* 主题色彩系统 */
    --primary: #166CE0;
    --primary-light: #4090ff;
    --primary-dark: #0D4C9E;
    --secondary: #6c63ff;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --dark: #343a40;
    --light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-light: #f5f7fa;
    --bg-gray: #f0f2f5;
    --text-primary: #333333;
    --text-secondary: #6c757d;
    --text-light: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
}

/* 重置基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-gray);
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 布局容器 */
.container {
    width: 100%;
    padding-right: 16px;
    padding-left: 16px;
    margin-right: auto;
    margin-left: auto;
    max-width: 640px;
}

.content-container {
    padding-top: 30px;
    padding-bottom: 65px;
}

/* App容器 */
#app {
    position: relative;
    min-height: 100vh;
    display: none;
}

/* 头部导航样式 */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
}

.refresh-icon {
    font-size: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.site-name {
    font-weight: 500;
    font-size: 16px;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-user {
    margin-right: 10px;
}

.user-icon {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.header-menu {
    background: rgba(0, 0, 0, 0.15);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 底部导航样式 */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55px;
    background: #fff;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.footer-nav {
    display: flex;
    height: 100%;
}

.footer-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.footer-item.active {
    color: var(--primary);
}

.footer-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.exchange-btn {
    cursor: pointer;
}

/* 加载动画 */
.app-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner-inner {
    position: relative;
}

.spinner-circle {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-text {
    margin-top: 12px;
    color: var(--text-secondary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 卡片组件 */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:active {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover,
.btn-outline:active {
    background: var(--primary);
    color: #fff;
}

.btn-block {
    width: 100%;
    display: block;
}

/* 左侧菜单 */
.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    background: #fff;
    width: 80%;
    max-width: 280px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: none;
}

.side-nav.active {
    transform: translateX(0);
}

.side-nav-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    background: var(--primary);
    color: #fff;
}

.side-nav-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.side-nav-title {
    display: flex;
    flex-direction: column;
}

.side-nav-title span:first-child {
    font-size: 13px;
    opacity: 0.85;
}

.side-nav-title span:last-child {
    font-size: 16px;
    font-weight: 500;
}

.side-nav-list {
    padding: 8px 0;
}

.side-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.side-nav-item:hover,
.side-nav-item.active {
    background: var(--bg-light);
    color: var(--primary);
}

.side-nav-item i {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.side-nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.side-nav-section {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.side-nav-footer {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
}

/* 遮罩层 */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

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

.mt-2 {
    margin-top: 8px;
}

.mb-2 {
    margin-bottom: 8px;
}

.my-2 {
    margin-top: 8px;
    margin-bottom: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mb-3 {
    margin-bottom: 12px;
}

.my-3 {
    margin-top: 12px;
    margin-bottom: 12px;
}