* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    padding-bottom: 80px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    background-color: #f9f9f9;
    padding: 12px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 70px;
}

.info-item:has(.info-action-btn) {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
}

.info-item:has(.info-action-btn) .info-label {
    display: none;
}

.info-item:has(.info-action-btn) .info-action-btn {
    margin-top: 0;
}

.info-label {
    color: #666;
    font-size: 12px;
    font-weight: 600;
}

.info-value {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    display: flex;
    align-items: center;
}

.info-action-btn {
    width: 100%;
    padding: 10px 12px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.info-action-btn:active {
    transform: scale(0.95);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-dhcp {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-static {
    background-color: #e8f5e9;
    color: #388e3c;
}

.badge-pppoe {
    background-color: #fff3e0;
    color: #f57c00;
}

.badge-success {
    background-color: #e8f5e9;
    color: #4CAF50;
}

.badge-error {
    background-color: #ffebee;
    color: #f44336;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-danger {
    background-color: #ff4d4f;
    color: white;
}

.btn-warning {
    background-color: #faad14;
    color: white;
}

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

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

.message {
    padding: 15px;
    margin: 15px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #4CAF50;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #f44336;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

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

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 12px;
    flex: 1;
    transition: all 0.3s ease;
}

.nav-item.active {
    color: #667eea;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #ccc;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: scale(0.98);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: white;
    margin: 50% auto;
    transform: translateY(-50%);
    padding: 10px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    border-radius: 12px;
    position: relative;
    top: 100px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 10px;
}

.modal-footer {
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.close {
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.back-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    margin-bottom: 12px;
}

.device-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.device-card:active {
    transform: scale(0.98);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.device-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.device-sn {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    flex: 1;
}

.device-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.device-status.online {
    background-color: #e8f5e9;
    color: #4CAF50;
}

.device-status.offline {
    background-color: #ffebee;
    color: #f44336;
}

.unbind-btn-header {
    padding: 6px 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.unbind-btn-header:active {
    transform: scale(0.95);
}

.device-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.device-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.action-btn {
    padding: 10px 8px;
    background-color: #e0e0e0;
    color: #333;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.action-btn:active {
    background-color: #e0e0e0;
    transform: scale(0.95);
}

.action-btn.detail {
    background-color: #e3f2fd;
    color: #2196F3;
}

.action-btn.unbind {
    background-color: #ffebee;
    color: #f44336;
}

.tag {
    display: inline-block;
    background-color: #e3f2fd;
    color: #1565c0;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    margin-right: 4px;
    margin-bottom: 4px;
    font-weight: 600;
}

.income-list {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.income-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

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

.income-date {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.income-amount {
    font-size: 18px;
    font-weight: 700;
    color: #4CAF50;
}

.stats-container {
    padding: 15px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.stat-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 10px 0;
}

.stat-unit {
    font-size: 16px;
    color: #999;
    margin-left: 5px;
}

.bank-card-section {
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.withdrawal-form {
    background: white;
    padding: 12px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.records-section {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.record-item {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}

.record-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.record-date {
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

.record-amount {
    font-size: 14px;
    font-weight: 700;
    color: #2196F3;
}

.record-status {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

.record-status.pending {
    background-color: #fff3e0;
    color: #FF9800;
}

.record-status.processing {
    background-color: #e3f2fd;
    color: #2196F3;
}

.record-status.completed {
    background-color: #e8f5e9;
    color: #4CAF50;
}

.logout-section {
    background: white;
    padding: 12px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.logout-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.25);
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(244, 67, 54, 0.35);
}

.logout-btn:active {
    transform: translateY(0);
}

.biz-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.biz-card-odd {
    background-color: #fffbe6;
}

.biz-card:active {
    transform: scale(0.98);
}

.biz-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.biz-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.biz-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
}

.price-label {
    color: #666;
    font-weight: 600;
}

.price-value {
    color: #2196F3;
    font-weight: 700;
}

.price-isp {
    color: #999;
    font-size: 10px;
}

.biz-desc {
    color: #666;
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.biz-tags {
    margin-bottom: 10px;
}

.bind-form {
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.form-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.form-desc {
    color: #666;
    font-size: 11px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.scan-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.scan-btn:active {
    transform: scale(0.98);
}

.reset-btn {
    width: 100%;
    padding: 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.reset-btn:active {
    transform: scale(0.98);
}

.detail-container {
    padding: 10px;
}

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 15px 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.config-item {
    background-color: #fafafa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #f0f0f0;
}

.config-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.config-item-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.config-item-detail {
    font-size: 12px;
    color: #666;
    line-height: 1.8;
}

.config-item-detail span {
    display: block;
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.success-modal-content {
    text-align: center;
    padding: 30px;
}

.success-icon {
    font-size: 60px;
    color: #4CAF50;
    margin-bottom: 20px;
}

.success-message {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

.success-close-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.success-close-btn:active {
    transform: scale(0.98);
}

.tag-modal-content {
    max-height: 100vh;
    overflow-y: auto;
}

.tag-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.tag-section {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 10px;
}

.tag-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.tag-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 6px;
    position: relative;
    white-space: nowrap;
}

.tag-item input[type="checkbox"] {
    display: none;
}

.tag-item .tag-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.tag-item .check-mark {
    display: none;
}

.tag-item input[type="checkbox"]:checked + .tag-text {
    color: #667eea;
}

.tag-item:has(input[type="checkbox"]:checked) {
    border-color: #667eea;
    background-color: #f0f5ff;
}

.tag-item:hover {
    background-color: #f0f0f0;
    border-color: #667eea;
}

.tag-item:has(input[type="checkbox"]:checked):hover {
    background-color: #e8f0ff;
}

.tag-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f0f0f0;
    border-color: #e0e0e0;
}

.tag-item.disabled:hover {
    background-color: #f0f0f0;
    border-color: #e0e0e0;
}

.biz-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.biz-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.biz-item.selected {
    border-color: #667eea;
    background-color: #f0f5ff;
}

.biz-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.biz-item:hover {
    background-color: #f0f5ff;
    border-color: #667eea;
}

.biz-item input[type="radio"] {
    margin-right: 8px;
    margin-top: 2px;
    display: none;
}

.biz-item .biz-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.biz-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding-left: 24px;
}

.biz-price .price-item {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.biz-tag-warning {
    background-color: #fff3e0;
    color: #f57c00;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid #ffe0b2;
}

.tag-status-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.tag-status-item {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tag-status-item input[type="radio"] {
    margin-right: 8px;
}

.fee-info {
    background: #f9f9f9;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
    color: #666;
}

.fee-item:last-child {
    margin-bottom: 0;
}

.fee-item strong {
    color: #333;
}

.fee-highlight {
    color: #2196F3;
    font-weight: 700;
    font-size: 13px;
}

@media (min-width: 768px) {
    .stats-container,
    .detail-container,
    .biz-list,
    .bind-container {
        max-width: 800px;
        margin: 0 auto;
    }

    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-value {
        font-size: 40px;
    }

    .device-info {
        grid-template-columns: repeat(3, 1fr);
    }

    .device-actions {
        grid-template-columns: repeat(5, 1fr);
    }
}
