* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #2c3e50;
    line-height: 1.6;
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Header ---- */
.app-header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    color: #fff;
    padding: 24px 0 20px;
}

.header-inner { text-align: center; }

.app-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: 0.5px;
}

.app-subtitle {
    font-size: 13px;
    opacity: 0.7;
    margin: 0;
}

/* ---- Container ---- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

main.container {
    padding-top: 20px;
    padding-bottom: 40px;
    flex: 1;
}

/* ---- 选项卡导航 ---- */
.nav-tabs-custom {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.tab-btn:hover { color: #1a237e; background: #f5f5f5; }

.tab-btn.active {
    color: #1a237e;
    border-bottom-color: #1a237e;
    font-weight: 600;
}

/* ---- 内容卡片 ---- */
.content-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card-header-custom {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #edf0f5;
}

.card-title-custom {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 2px;
    color: #1a237e;
}

.card-desc {
    font-size: 12px;
    color: #999;
}

.card-body-custom { padding: 20px; }

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

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.optional {
    font-weight: 400;
    color: #aaa;
    font-size: 12px;
}

.field-hint {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.text-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.text-input:focus {
    border-color: #3949ab;
    box-shadow: 0 0 0 3px rgba(57,73,171,0.1);
}

.text-input-lg {
    font-size: 15px;
    padding: 11px 14px;
}

.text-input::placeholder { color: #bbb; }

/* ---- 文件选择器 ---- */
.file-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-file {
    padding: 8px 28px;
    font-size: 14px;
    color: #333;
    background: #f8f9fa;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-file:hover { background: #e9ecef; }

.file-name {
    font-size: 13px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- 表单行 ---- */
.form-row {
    display: flex;
    gap: 12px;
}

.flex-1 { flex: 1; min-width: 0; }

/* ---- 按钮 ---- */
.btn-primary {
    display: block;
    width: 100%;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #1a237e;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover { background: #283593; }

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

.btn-download {
    display: inline-block;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: #2e7d32;
    border-radius: 4px;
    text-decoration: none;
}

.btn-download:hover { background: #1b5e20; color: #fff; }

/* ---- 状态栏 ---- */
.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
}

.status-processing {
    background: #f0f4ff;
    color: #1a237e;
}

.progress-track {
    width: 100px;
    height: 5px;
    background: #dde;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #3949ab, #5c6bc0);
    border-radius: 3px;
    animation: progress-indeterminate 1.4s infinite ease-in-out;
}

@keyframes progress-indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.status-success {
    background: #e8f5e9;
    color: #2e7d32;
    justify-content: space-between;
}

.status-error {
    background: #fef2f2;
    color: #c62828;
}

/* ---- 查询结果 ---- */
.query-result {
    margin-top: 16px;
    padding: 16px 18px;
    background: #fafbfc;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
}

.result-address {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
    word-break: break-all;
}

.result-address span { color: #333; }

.result-match {
    font-size: 15px;
    font-weight: 600;
    line-height: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.tag-committee {
    color: #1a237e;
    background: #e8eaf6;
}

.tag-block {
    color: #4e342e;
    background: #fbe9e7;
}

.tag-community {
    color: #4a148c;
    background: #f3e5f5;
}

.tag-building {
    color: #1b5e20;
    background: #e8f5e9;
}

.tag-unmatched {
    color: #c62828;
    background: #fef2f2;
}

/* ---- 隐藏面板 ---- */
.tab-pane-custom { display: none; }
.tab-pane-custom.active { display: block; }

/* ---- 手机端适配 ---- */
@media (max-width: 480px) {
    .app-title { font-size: 18px; }
    .app-subtitle { font-size: 12px; }
    .app-header { padding: 18px 0 14px; }
    .tab-btn { font-size: 14px; padding: 8px 0; }
    .card-body-custom { padding: 16px; }
    .card-header-custom { padding: 14px 16px 10px; }
    .form-row { flex-direction: column; gap: 0; }
    .result-match { font-size: 16px; }
    .text-input-lg { font-size: 14px; padding: 10px 12px; }
}
