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

:root {
    --primary-color: #FF6B35;
    --primary-light: #fff0eb;
    --success-color: #10B981;
    --success-light: #d1fae5;
    --error-color: #EF4444;
    --error-light: #fee2e2;
    --info-color: #3B82F6;
    --info-light: #dbeafe;
    --warning-color: #F59E0B;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 24px;
}

/* 头部区域 */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff8f6b 100%);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 10px 20px rgba(255, 107, 53, 0.3);
}

.logo-icon {
    font-size: 42px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.header .subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

.header p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-body {
    padding: 32px;
}

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

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.form-label .required {
    color: var(--error-color);
    font-weight: 400;
}

.form-label .badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary-color);
}

.form-textarea {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    resize: vertical;
    transition: all 0.2s ease;
    background: var(--border-light);
    min-height: 200px;
    line-height: 1.6;
}

.form-textarea:hover {
    border-color: #d1d5db;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

/* Token状态提示 */
.token-status {
    margin-top: 12px;
    font-size: 14px;
}

.status-ok {
    color: #065f46;
    background: var(--success-light);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.status-warn {
    color: #92400e;
    background: #fffbeb;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.status-err {
    color: #991b1b;
    background: var(--error-light);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* 帮助区域 */
.help-card {
    background: var(--border-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.help-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.2s ease;
    user-select: none;
}

.help-toggle:hover {
    background: rgba(0, 0, 0, 0.03);
}

.help-toggle .icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-toggle .icon::before {
    content: "?";
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.help-toggle .arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.help-toggle.active .arrow {
    transform: rotate(180deg);
}

.help-body {
    display: none;
    padding: 16px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.help-body.show {
    display: block;
}

.help-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.help-steps li {
    position: relative;
    padding: 10px 0 10px 36px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 10px;
    width: 24px;
    height: 24px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.help-steps li + li {
    border-top: 1px dashed var(--border-color);
}

.help-steps a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.help-steps a:hover {
    text-decoration: underline;
}

.help-steps kbd {
    display: inline-block;
    padding: 2px 8px;
    background: var(--text-primary);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
}

.help-steps code {
    padding: 2px 6px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.help-steps strong {
    color: var(--text-primary);
    font-weight: 600;
}

.help-tip {
    margin-top: 16px;
    padding: 12px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.help-tip::before {
    content: "💡";
    flex-shrink: 0;
}

/* 参考图片 */
.ref-image {
    margin: 16px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
}

.ref-image-header {
    padding: 12px 16px;
    background: var(--border-light);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.ref-image:hover .ref-image-header {
    background: #e5e7eb;
}

.ref-image-body {
    display: none;
    background: #1e1e1e;
}

.ref-image-body.show {
    display: block;
}

.ref-image-body svg {
    width: 100%;
    height: auto;
    display: block;
}

/* 按钮 */
.btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 32px;
    border: none;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: #374151;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff8f6b 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

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

.btn-icon {
    font-size: 16px;
}

.btn-icon-svg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    filter: brightness(0) invert(1);
}

.title-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.title-icon.spin {
    animation: spin 1s linear infinite;
}

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

/* 状态区域 */
.status-card {
    margin-top: 20px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
}

.status-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
    padding: 4px;
}

.status-close:hover {
    opacity: 1;
}

.status-body {
    padding: 14px 16px;
    font-size: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.status-success {
    background: var(--success-light);
    color: #065f46;
}

.status-success .status-header {
    background: rgba(16, 185, 129, 0.1);
}

.status-error {
    background: var(--error-light);
    color: #991b1b;
}

.status-error .status-header {
    background: rgba(239, 68, 68, 0.1);
}

.status-info {
    background: var(--info-light);
    color: #1e40af;
}

.status-info .status-header {
    background: rgba(59, 130, 246, 0.1);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 24px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary-color);
}

/* 响应式 */
@media (max-width: 480px) {
    .app-container {
        padding: 24px 16px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .btn-row {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
    }
}

/* Token简洁显示 */
.token-simple {
    background: var(--border-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 20px;
}

.token-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.token-row + .token-row {
    border-top: 1px dashed var(--border-color);
}

.token-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 70px;
    font-family: 'SF Mono', 'Monaco', monospace;
}

.token-value {
    flex: 1;
    font-size: 13px;
    font-family: 'SF Mono', 'Monaco', monospace;
    color: var(--text-primary);
    background: white;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.token-value.empty {
    color: var(--text-muted);
    font-style: italic;
}

.copy-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 签到结果卡片 */
.result-card {
    margin-top: 20px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    animation: slideDown 0.3s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    background: var(--border-light);
}

.result-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    line-height: 1;
}

.result-close:hover {
    opacity: 1;
}

.result-body {
    padding: 16px;
    background: white;
    max-height: 300px;
    overflow-y: auto;
}

.log-line {
    padding: 10px 0;
    font-size: 14px;
    line-height: 1.5;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-line:last-child {
    border-bottom: none;
}

.log-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.log-success, .log-status, .log-streak {
    color: #065f46;
}

.log-error {
    color: #991b1b;
}

.log-info, .log-user, .log-coin, .log-exp {
    color: var(--text-primary);
}

.result-success {
    border-color: var(--success-color);
}

.result-success .result-header {
    background: var(--success-light);
    color: #065f46;
}

.result-error {
    border-color: var(--error-color);
}

.result-error .result-header {
    background: var(--error-light);
    color: #991b1b;
}

.result-info .result-header {
    background: var(--info-light);
    color: #1e40af;
}

/* Toast提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    background: var(--text-primary);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

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

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 自动签到提示 */
.auto-checkin-tip {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef3c7;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    color: #92400e;
}

/* 免责声明 */
.disclaimer {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    border-left: 3px solid #9ca3af;
}

.disclaimer p {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Token列表弹窗 */
.token-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

/* Token表格 */
.token-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.token-table th,
.token-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.token-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.token-table tr:hover {
    background: #f9fafb;
}

.status-active {
    color: #059669;
    font-weight: 500;
}

.status-inactive {
    color: #9ca3af;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #e5e7eb;
    color: #374151;
    margin-right: 4px;
}

.btn-small:hover {
    background: #d1d5db;
}

.btn-small.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

.btn-small.btn-danger:hover {
    background: #fecaca;
}


/* 服务状态指示灯 */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #9ca3af;
    transition: all 0.3s ease;
}

.status-dot.status-online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse-green 2s infinite;
}

.status-dot.status-offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
    50% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.8); }
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.8); }
}

.status-text {
    font-weight: 500;
    color: var(--text-secondary);
}

.status-text-ok {
    color: #16a34a;
}

.status-text-err {
    color: #dc2626;
}

.status-uptime {
    color: var(--text-muted);
    font-size: 13px;
}
