/* === 公共样式（所有页面共用） === */

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

:root {
    --color-primary: #FD4A46;
    --color-secondary: #7E71F6;
    --color-bg: #F5F5F5;
    --color-text: #333;
    --color-text-light: #999;
    --color-border: #eee;
}

body {
    font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 50px;
}

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

/* 导航栏 */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 44px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.nav-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
}

.nav-icons {
    display: flex;
    gap: 16px;
}

.nav-icon img {
    width: 22px;
    height: 22px;
    opacity: 0.7;
}

/* 底部 TabBar */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    display: flex;
    background: #fff;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.08);
    z-index: 100;
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
}

.tabbar-item img {
    width: 24px;
    height: 24px;
    opacity: 0.5;
}

.tabbar-item span {
    font-size: 10px;
    color: #BBB;
}

.tabbar-item.active img {
    opacity: 1;
}

.tabbar-item.active span {
    color: var(--color-primary);
    font-weight: 600;
}

/* === 首页 === */
.home-content {
    background: var(--color-bg);
}

.home-section {
    margin-bottom: 8px;
}

.home-picture {
    background: #fff;
}

.full-width-img {
    width: 100%;
    height: auto;
}

.home-guanggao {
    background: #fff;
}

.home-intro {
    padding: 16px;
}

.intro-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.intro-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    margin: 0 auto 12px;
    object-fit: cover;
}

.intro-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.intro-desc {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

.intro-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.feature-item {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

.intro-btn {
    display: inline-block;
    padding: 10px 32px;
    background: linear-gradient(135deg, var(--color-secondary), #9d90ff);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
}

/* === 分类/说明书页 === */
.category-content {
    padding: 16px;
}

.category-header {
    text-align: center;
    margin-bottom: 20px;
}

.category-header img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 12px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
}

.category-desc {
    font-size: 13px;
    color: var(--color-text-light);
    margin-top: 4px;
}

.doc-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.doc-section h3 {
    font-size: 15px;
    color: var(--color-text);
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid var(--color-primary);
}

.doc-section p {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

.doc-section ol {
    padding-left: 20px;
}

.doc-section ol li {
    font-size: 14px;
    color: #666;
    line-height: 2;
}

/* === 我的设备页 === */
.device-content {
    padding: 16px;
}

.device-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    text-align: center;
}

.device-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.device-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.device-sn {
    font-size: 13px;
    color: var(--color-text-light);
    font-family: monospace;
}

.bind-form {
    margin-top: 16px;
}

.bind-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 12px;
}

.bind-btn {
    width: 100%;
    padding: 12px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.device-list {
    margin-top: 12px;
}

.device-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.device-item-info {
    flex: 1;
}

.device-item-name {
    font-size: 14px;
    font-weight: 500;
}

.device-item-sn {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 2px;
}

.device-item-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-bound { background: #e8f5e9; color: #22c55e; }
.statusunbind { background: #fff3e0; color: #f59e0b; }

/* === 余额提现页 === */
.withdraw-content {
    padding: 16px;
}

.balance-card {
    background: linear-gradient(135deg, var(--color-secondary), #9d90ff);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    margin-bottom: 12px;
}

.balance-label {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.balance-unit {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.withdraw-form {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.form-label {
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 8px;
    display: block;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 12px;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-secondary);
}

.withdraw-all-btn {
    color: var(--color-secondary);
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 12px;
    display: inline-block;
}

.withdraw-submit {
    width: 100%;
    padding: 12px;
    background: var(--color-secondary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.withdraw-tips {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.withdraw-tips h4 {
    font-size: 14px;
    margin-bottom: 8px;
}

.withdraw-tips p {
    font-size: 12px;
    color: var(--color-text-light);
    line-height: 1.8;
}

/* === 个人设置页 === */
.settings-content {
    padding: 16px;
}

.settings-group {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.settings-group-title {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 8px;
    padding-left: 4px;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:active {
    background: #f9f9f9;
}

.settings-label {
    flex: 1;
    font-size: 15px;
}

.settings-value {
    font-size: 14px;
    color: var(--color-text-light);
    margin-right: 8px;
}

.settings-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.settings-arrow {
    color: #ccc;
    font-size: 18px;
}

.logout-btn {
    width: 100%;
    padding: 14px;
    background: #fff;
    color: var(--color-primary);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* === Toast === */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
}

.toast-msg {
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 260px;
    text-align: center;
    animation: toastFade 0.3s ease;
}

@keyframes toastFade {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
