/* 公共样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #409eff;
    text-decoration: none;
}

a:hover {
    color: #66b1ff;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: 14px;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.header .logo {
    font-size: 20px;
    font-weight: bold;
    color: #409eff;
}

.header .nav {
    display: flex;
    gap: 20px;
}

.header .nav a {
    color: #606266;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.header .nav a:hover,
.header .nav a.active {
    color: #409eff;
    border-bottom-color: #409eff;
}

.header .user-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header .user-area .balance {
    color: #f56c6c;
    font-weight: bold;
}

.header .user-area .btn {
    padding: 6px 16px;
    font-size: 14px;
}

/* 主体内容 */
.main {
    padding: 20px 0;
    min-height: calc(100vh - 160px);
}

/* 页面标题 */
.page-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #303133;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #409eff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #66b1ff;
}

.btn-success {
    background-color: #67c23a;
    color: #fff;
}

.btn-success:hover {
    background-color: #85ce61;
}

.btn-danger {
    background-color: #f56c6c;
    color: #fff;
}

.btn-danger:hover {
    background-color: #f78989;
}

.btn-warning {
    background-color: #e6a23c;
    color: #fff;
}

.btn-warning:hover {
    background-color: #ebb563;
}

.btn-default {
    background-color: #fff;
    color: #606266;
    border: 1px solid #dcdfe6;
}

.btn-default:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 12px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 卡片 */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ebeef5;
    color: #303133;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #606266;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #409eff;
}

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    resize: vertical;
    min-height: 100px;
}

.form-textarea:focus {
    outline: none;
    border-color: #409eff;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background-color: #fff;
}

.form-select:focus {
    outline: none;
    border-color: #409eff;
}

.form-error {
    color: #f56c6c;
    font-size: 12px;
    margin-top: 5px;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

/* 确保状态列有足够宽度 */
.table th:last-child,
.table td:last-child {
    min-width: 100px;
    width: 100px;
    text-align: center;
}

.table th:first-child,
.table td:first-child {
    min-width: 150px;
}

.table th {
    background-color: #fafafa;
    font-weight: 600;
    color: #909399;
    font-size: 14px;
}

.table tr:hover {
    background-color: #f5f7fa;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination .btn {
    padding: 5px 15px;
    font-size: 13px;
}

.pagination .page-info {
    color: #606266;
    font-size: 14px;
}

/* 状态标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.tag-success {
    background-color: #f0f9eb;
    color: #67c23a;
}

.tag-warning {
    background-color: #fdf6ec;
    color: #e6a23c;
}

.tag-danger {
    background-color: #fef0f0;
    color: #f56c6c;
}

.tag-info {
    background-color: #f4f4f5;
    color: #909399;
}

.tag-primary {
    background-color: #ecf5ff;
    color: #409eff;
}

/* 登录/注册页面 */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    width: 400px;
    padding: 40px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.auth-card .auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #303133;
    margin-bottom: 30px;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #909399;
    font-size: 14px;
}

/* 资产列表 */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.asset-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.asset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.asset-card .asset-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 48px;
}

.asset-card .asset-content {
    padding: 20px;
}

.asset-card .asset-name {
    font-size: 18px;
    font-weight: bold;
    color: #303133;
    margin-bottom: 10px;
}

.asset-card .asset-desc {
    color: #909399;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asset-card .asset-price {
    font-size: 24px;
    color: #f56c6c;
    font-weight: bold;
    margin-bottom: 10px;
}

.asset-card .asset-shares {
    display: flex;
    justify-content: space-between;
    color: #909399;
    font-size: 13px;
    margin-bottom: 15px;
}

.asset-card .progress-bar {
    height: 6px;
    background-color: #ebeef5;
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
}

.asset-card .progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, #409eff 0%, #67c23a 100%);
    border-radius: 3px;
    transition: width 0.3s;
}

.asset-card .asset-actions {
    display: flex;
    gap: 10px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.stat-card .stat-label {
    color: #909399;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #303133;
}

.stat-card.primary .stat-value {
    color: #409eff;
}

.stat-card.success .stat-value {
    color: #67c23a;
}

.stat-card.danger .stat-value {
    color: #f56c6c;
}

.stat-card.warning .stat-value {
    color: #e6a23c;
}

/* 底部 */
.footer {
    background-color: #fff;
    padding: 20px 0;
    text-align: center;
    color: #909399;
    font-size: 14px;
    border-top: 1px solid #ebeef5;
}

/* 汉堡菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    display: block;
    width: 24px;
    height: 3px;
    background-color: #606266;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -8px);
}

/* 移动端导航 */
.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 0;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-nav.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    color: #606266;
    font-size: 16px;
    border-bottom: 1px solid #ebeef5;
    transition: all 0.2s;
}

.mobile-nav a:active {
    background-color: #ecf5ff;
    color: #409eff;
}

.mobile-nav a.active {
    color: #409eff;
    background-color: #ecf5ff;
    border-left: 4px solid #409eff;
}

/* 用户区域折叠 */
.user-area-mobile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 15px 20px;
    background-color: #fafafa;
    border-bottom: 1px solid #ebeef5;
}

.user-area-mobile .balance {
    color: #f56c6c;
    font-weight: bold;
    font-size: 16px;
}

/* 移动端底部导航 */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 0;
    border-top: 1px solid #ebeef5;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    overflow: hidden;
}

.bottom-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.bottom-nav li {
    flex: 1;
    text-align: center;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    color: #909399;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav a:active {
    background-color: #f5f7fa;
}

.bottom-nav a.active {
    color: #409eff;
}

.bottom-nav .nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
    line-height: 1;
}

/* 为底部导航留出空间 */
.main {
    padding-bottom: 70px;
}

.footer {
    padding-bottom: 80px;
}

/* 触摸优化 */
a, button {
    -webkit-tap-highlight-color: transparent;
}

button:active {
    opacity: 0.8;
}

/* 安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .main {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
    
    .footer {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* 表格响应式容器 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 卡片式表格 */
.table-mobile {
    display: block;
}

.table-mobile thead {
    display: none;
}

.table-mobile tbody {
    display: block;
}

.table-mobile tr {
    display: block;
    margin-bottom: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 15px;
}

.table-mobile td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 !important;
    border-bottom: 1px solid #f0f0f0;
}

.table-mobile td:last-child {
    border-bottom: none;
}

.table-mobile td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #606266;
    flex-shrink: 0;
    margin-right: 10px;
}

.table-mobile td:last-child .tag {
    display: inline-block;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    padding: 4px 10px;
    font-size: 13px;
}

/* 空状态和加载状态行在移动端保持正常显示 */
.table-mobile tr.empty-row,
.table-mobile tr.loading-row {
    display: table-row;
    margin-bottom: 0;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.table-mobile td.empty-cell,
.table-mobile td.loading-cell {
    display: table-cell;
    justify-content: center;
    align-items: center;
    padding: 12px 15px !important;
    border-bottom: 1px solid #ebeef5;
}

.table-mobile td.empty-cell::before,
.table-mobile td.loading-cell::before {
    content: none;
}

/* 响应式 */
@media (max-width: 768px) {
    .header .container {
        padding: 0 15px;
    }
    
    .header .nav {
        display: none;
    }
    
    .header .user-area {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .bottom-nav {
        display: block;
    }
    
    .auth-card {
        width: 92%;
        padding: 25px 18px;
    }
    
    .auth-card .auth-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .asset-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card .stat-value {
        font-size: 22px;
    }
    
    .page-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .btn {
        min-height: 44px;
        align-items: center;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 12px 14px;
        font-size: 15px;
        min-height: 44px;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
        white-space: normal;
        word-break: keep-all;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        padding-bottom: 15px;
    }
    
    .pagination .btn {
        padding: 10px 18px;
        min-height: 44px;
    }
    
    .pagination .page-info {
        width: 100%;
        text-align: center;
        order: -1;
    }
    
    .modal-content {
        width: 92%;
        padding: 25px 18px;
        margin: 10px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-state .icon {
        font-size: 48px;
    }
    
    .loading {
        padding: 30px 15px;
    }
    
    .footer {
        font-size: 12px;
        padding: 15px 15px 90px 15px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .asset-card .asset-image {
        height: 140px;
        font-size: 40px;
    }
    
    .asset-card .asset-content {
        padding: 15px;
    }
    
    .asset-card .asset-price {
        font-size: 20px;
    }
    
    .asset-card .asset-name {
        font-size: 16px;
    }
    
    .asset-card .asset-actions {
        flex-direction: column;
    }
    
    .asset-card .asset-actions .btn {
        width: 100%;
    }
    
    .page-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .card {
        padding: 12px;
    }
    
    .table {
        font-size: 13px;
        min-width: 700px;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
    }
    
    .table td .empty-state,
    .table td .loading {
        padding: 30px 15px;
    }
    
    .pagination {
        gap: 6px;
    }
    
    .pagination .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .modal-content {
        width: 94%;
        padding: 20px 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px;
    }
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 40px;
    color: #909399;
}

.loading .spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #ebeef5;
    border-top-color: #409eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #909399;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state .text {
    font-size: 16px;
}

/* 表格中空状态 */
.table td {
    vertical-align: middle;
}

.table td .empty-state,
.table td .loading {
    text-align: center;
    margin: 0;
    padding: 40px 20px;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    width: 400px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.asset-detail-layout {
    display: flex;
    gap: 30px;
}

.asset-detail-image-wrap {
    flex: 0 0 300px;
}

.asset-detail-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 64px;
}

.asset-detail-info {
    flex: 1;
}

.asset-detail-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #303133;
}

.asset-detail-desc {
    color: #909399;
    margin-bottom: 20px;
    line-height: 1.8;
}

.asset-detail-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.asset-stat-card {
    background: #f5f7fa;
    padding: 15px;
    border-radius: 4px;
}

.asset-stat-label {
    color: #909399;
    font-size: 14px;
    margin-bottom: 5px;
}

.asset-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #303133;
}

.asset-stat-value.price {
    color: #f56c6c;
}

.asset-stat-value.success {
    color: #67c23a;
}

.asset-stat-value.primary {
    color: #409eff;
}

.asset-detail-progress-wrap {
    margin-bottom: 20px;
}

.asset-detail-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.asset-detail-progress-label {
    color: #909399;
}

.asset-detail-progress-percent {
    color: #606266;
}

.asset-detail-actions {
    display: flex;
    gap: 15px;
}

@media (max-width: 768px) {
    .asset-detail-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .asset-detail-image-wrap {
        flex: none;
    }
    
    .asset-detail-image {
        height: 180px;
        font-size: 48px;
    }
    
    .asset-detail-title {
        font-size: 20px;
    }
    
    .asset-detail-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .asset-stat-card {
        padding: 12px;
    }
    
    .asset-stat-value {
        font-size: 20px;
    }
    
    .asset-detail-actions {
        flex-direction: column;
    }
    
    .asset-detail-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .asset-detail-stats {
        grid-template-columns: 1fr;
    }
    
    .asset-detail-image {
        height: 140px;
        font-size: 40px;
    }
}
