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

:root {
    --primary: #FFD93D;
    --primary-dark: #F5A623;
    --accent: #6BCB77;
    --bg: #F7F8FA;
    --card: #FFFFFF;
    --text: #2C3E50;
    --text-light: #7F8C8D;
    --border: #E8E8E8;
    --danger: #E74C3C;
    --radius: 12px;
}

html {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    -webkit-overflow-scrolling: touch;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
}

/* 顶部导航 */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 16px 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    padding-bottom: 14px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-tabs {
    display: flex;
    gap: 0;
}

.nav-tab {
    flex: 1;
    padding: 12px 0;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.nav-tab.active {
    color: #fff;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

/* 页面切换 */
.page {
    display: none;
    padding: 16px;
}

.page.active {
    display: block;
}

/* 表单 */
.form-container {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.form-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #FFF8E1;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #8D6E00;
    line-height: 1.5;
}

.tip-icon {
    flex-shrink: 0;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 20px 0 12px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

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

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

.required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: #FAFBFC;
    transition: all 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-dark);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,217,61,0.15);
}

.form-group textarea {
    resize: none;
    font-family: inherit;
}

/* 类型选择 */
.type-selector {
    display: flex;
    gap: 12px;
}

/* 企业快捷键 */
.quick-companies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-btn {
    padding: 8px 16px;
    background: #F5F6FA;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

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

.quick-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(245,166,35,0.3);
}

.type-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #FAFBFC;
}

.type-option input {
    display: none;
}

.type-option span {
    font-size: 14px;
    color: var(--text-light);
}

.type-option:has(input:checked) {
    border-color: var(--primary-dark);
    background: #FFF8E1;
}

.type-option:has(input:checked) span {
    color: var(--primary-dark);
    font-weight: 600;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(245,166,35,0.3);
    transition: all 0.2s;
}

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

/* 记录列表 */
.records-container {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    min-height: 400px;
}

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

.records-header h3 {
    font-size: 16px;
}

.refresh-btn {
    padding: 6px 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-item {
    padding: 14px;
    background: #FAFBFC;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.record-item.failed {
    border-left-color: var(--danger);
}

.record-item.processing {
    border-left-color: var(--primary-dark);
}

.record-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.record-meta {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
}

.record-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-top: 6px;
}

.status-done { background: #E8F5E9; color: #2E7D32; }
.status-pending, .status-submitting, .status-waiting_sms, .status-filling { background: #FFF3E0; color: #E65100; }
.status-failed { background: #FFEBEE; color: #C62828; }

.empty-tip {
    text-align: center;
    color: var(--text-light);
    padding: 60px 0;
    font-size: 14px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

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

.modal-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}

.sms-input-group input {
    width: 100%;
    padding: 14px;
    font-size: 20px;
    text-align: center;
    letter-spacing: 8px;
    border: 2px solid var(--border);
    border-radius: 8px;
    outline: none;
    margin-bottom: 16px;
}

.sms-input-group input:focus {
    border-color: var(--primary-dark);
}

.modal-btns {
    display: flex;
    gap: 12px;
}

.btn-primary {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.resend-tip {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.result-code {
    background: #F5F5F5;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 16px;
    word-break: break-all;
}

/* 加载遮罩 */
.loading-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-mask.active {
    display: flex;
}

.loading-box {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--primary-dark);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

.loading-box p {
    font-size: 14px;
    color: var(--text);
}

/* 省市区选择 */
.region-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.region-row select {
    flex: 1;
    min-width: 0;
}

.detail-address {
    margin-top: 8px;
}

/* 详细描述填写指引 */
.desc-guide {
    margin-top: 8px;
    padding: 10px 12px;
    background: #F7FBF7;
    border: 1px dashed #B7E0BA;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.7;
}

.desc-guide b {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
}

.desc-guide p {
    margin: 0;
}
