/* 全局基础 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px 10px;
}

.container {
    max-width: 750px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* 头部 */
header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 36px;
    color: #d32f2f;
    margin: 0;
    letter-spacing: 2px;
    font-weight: 800;
    display: inline-block;
    position: relative;
}

.slogan {
    color: #666;
    font-size: 16px;
    margin-top: 8px;
}

/* 问号图标 */
.help-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background-color: #e0e0e0;
    color: #666;
    border-radius: 50%;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    margin-left: 5px;
    vertical-align: middle;
    transition: all 0.2s;
}

.help-icon:hover {
    background-color: #d32f2f;
    color: white;
    transform: scale(1.1);
}

/* 弹窗样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: auto;
    padding: 0;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-body ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.modal-body li {
    margin-bottom: 10px;
}

/* 模块与表单 */
.section {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.section h2 {
    font-size: 18px;
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

input[type="text"], select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

.tip {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

/* 单选框组 */
.identity-group {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.radio-label {
    font-weight: normal !important;
    font-size: 14px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

/* 违规类型卡片 */
.card {
    background: #fafafa;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.card h3 {
    margin-top: 0;
    font-size: 16px;
}

.checkbox-label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.custom-input {
    display: none;
    margin-top: 8px;
    margin-left: 26px;
    width: calc(100% - 26px);
    border: 1px dashed #999;
    background: #fffde7;
}

.card.active {
    border-left-color: #d32f2f;
    background: #fff5f5;
}

/* 警告框与按钮 */
.warning-box {
    background-color: #fff8e1;
    border-color: #ffecb3;
}

.warning-box strong {
    color: #f57f17;
}

button {
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

button:hover:not(:disabled) {
    background-color: #b71c1c;
}

button:disabled {
    background-color: #bdbdbd;
    cursor: not-allowed;
}

.letter-paper {
    background: #fff;
    padding: 30px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    font-size: 15px;
    line-height: 2;
    text-align: justify;
}

.letter-paper p {
    margin: 0 0 10px 0;
}

.action-btns {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btns button {
    width: auto;
    flex: 1;
    font-size: 14px;
    padding: 10px;
}

.btn-secondary {
    background-color: #757575;
}

.btn-secondary:hover {
    background-color: #616161 !important;
}

footer {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    margin-top: 30px;
}

/* 打印优化 */
@media print {
    body {
        background: none;
        padding: 0;
    }
    .container {
        box-shadow: none;
        padding: 0;
    }
    header, .section, .action-btns, footer, button, .modal-overlay {
        display: none !important;
    }
    #resultBox {
        display: block !important;
        border: none;
        padding: 0;
    }
    .letter-paper {
        border: none;
        padding: 0;
    }
}

/* --- 智能动态防雷卡片样式 --- */
.guide-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-left: 5px solid #495057;
    border-radius: 4px;
    padding: 20px;
    margin-top: 10px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    line-height: 1.6;
}

#actionGuideBox {
    margin-top: 20px;
}

.guide-card .guide-step-title {
    font-size: 16px;
    font-weight: bold;
    color: #212529;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ced4da;
}

.guide-card .guide-step-title span {
    color: #6c757d;
    font-size: 13px;
    font-weight: normal;
    margin-left: 8px;
}

.guide-card .phone-guide-text {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    padding: 12px;
    border-radius: 4px;
    color: #3730a3;
    font-size: 13px;
}

.guide-card .channel-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-card .channel-item {
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #ccc;
}

.channel-item.safe-green {
    background-color: #f0fdf4;
    border-left-color: #16a34a;
}
.channel-item.safe-green .c-name { color: #15803d; }

.channel-item.safe-yellow {
    background-color: #fffbeb;
    border-left-color: #d97706;
}
.channel-item.safe-yellow .c-name { color: #b45309; }

.channel-item.safe-red {
    background-color: #fef2f2;
    border-left-color: #dc2626;
}
.channel-item.safe-red .c-name { color: #b91c1c; }

.channel-item .c-name {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 6px;
}

.channel-item .c-entry {
    font-family: monospace;
    background: rgba(255,255,255,0.6);
    padding: 4px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
    font-size: 13px;
    word-break: break-all;
}

.channel-item .c-tip {
    font-size: 12px;
    color: #555;
}

.channel-item.safe-red .c-tip {
    color: #991b1b;
    font-weight: bold;
}
