:root {
    --primary: #3498db;
    --secondary: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #27ae60;
    --gray: #95a5a6;
    --light: #ecf0f1;
    --dark: #2c3e50;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 25px;
    color: white;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 3rem;
    opacity: 0.9;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.required::after {
    content: " *";
    color: var(--danger);
}

.input-icon {
    position: relative;
}

.input-icon::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
}

input, select {
    width: 100%;
    padding: 14px 15px 14px 40px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.btn {
    background: linear-gradient(135deg, var(--primary), #2980b9);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.dynamic-fields {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 8px;
    border-left: 4px solid var(--primary);
}

footer {
    text-align: center;
    color: white;
    margin-top: 15px;
    opacity: 0.8;
    font-size: 12px;
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 15px;
        border-radius: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    input, select {
        padding: 16px 15px 16px 40px;
        font-size: 16px;
        min-height: 50px;
    }
    
    .btn {
        padding: 18px 20px;
        font-size: 16px;
    }
}

/* 触摸设备优化 */
.touch-device input,
.touch-device select,
.touch-device .btn {
    min-height: 50px;
}

/* 选择框样式 */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2395a5a6' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

/* 响应式网格 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .card {
        padding: 12px;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

/* 防止缩放 */
input[type="text"],
input[type="tel"],
select {
    font-size: 16px;
}

/* 成功/错误页面样式 */
.icon {
    font-size: 4rem;
    margin-bottom: 20px;
    text-align: center;
}

.error-icon {
    color: #e74c3c;
}

.success-icon {
    color: #27ae60;
}

.error-list {
    text-align: left;
    background: #ffe6e6;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error-list ul {
    margin: 0;
    padding-left: 20px;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.info-item {
    background: rgba(255,255,255,0.2);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.info-number {
    font-size: 1.5rem;
    font-weight: bold;
}

.info-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.complaint-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: left;
}

.info-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.info-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e1e8ed;
}

.info-item-row:last-child {
    border-bottom: none;
}

/* 自动提示样式 */
.autocomplete-container {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-highlight {
    color: #3498db;
    font-weight: bold;
}

/* 图标模拟 */
#name + .input-icon::before { 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2395a5a6' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); 
}

#phone + .input-icon::before { 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2395a5a6' stroke-width='2'%3E%3Crect x='5' y='2' width='14' height='20' rx='2' ry='2'/%3E%3Cline x1='12' y1='18' x2='12' y2='18'/%3E%3C/svg%3E"); 
}

#community_name + .input-icon::before { 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2395a5a6' stroke-width='2'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E"); 
}

#complaint_type + .input-icon::before { 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2395a5a6' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E"); 
}

/* 按钮图标 */
.btn::before {
    content: "📤";
    font-size: 18px;
}

/* 成功页面特定样式 */
.success-page .card {
    text-align: center;
    padding: 30px;
}

.success-page h2 {
    color: #27ae60;
    margin-bottom: 20px;
}

.success-page .complaint-info h3 {
    margin-top: 0;
    color: #3498db;
    text-align: center;
}

.success-page .contact-info {
    margin-bottom: 25px;
    color: #000000;
    text-align: center;
}

.success-page .action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 错误页面特定样式 */
.error-page .card {
    text-align: center;
    padding: 30px;
}

.error-page h2 {
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-page .btn-secondary {
    background: #95a5a6;
}
