/* === style.css === */

/* === 样式变量 === */
:root {
    --background-color: #f5f7fa;
    --panel-background: #ffffff;
    --text-color: #333333;
    --heading-color: #4a5568;
    --border-color: #e2e8f0;
    --primary-color: #667eea;
    --primary-hover: #5a6fd8;
    --secondary-color: #718096;
    --secondary-hover: #65758a;
    --success-color: #48bb78;
    --error-color: #e53e3e;
    --warning-color: #ed8936;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* === 基础样式 === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* === 头部 === */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* === 布局 === */
.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
}

/* === 面板 === */
.panel {
    background: var(--panel-background);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
}

.panel-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--heading-color);
    display: flex;
    align-items: center;
}

.panel-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* === 表单元素 === */
label {
    display: block;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--heading-color);
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 16px;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    min-height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

/* === 按钮 === */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    align-items: center;
}

button {
    background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, var(--primary-hover) 0%, #6a4190 100%);
}

button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #a0aec0 100%);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-hover) 0%, #92a1b5 100%);
}

.btn-clear {
    background: linear-gradient(135deg, var(--error-color) 0%, #c53030 100%);
}

.btn-clear:hover {
    background: linear-gradient(135deg, #d63030 0%, #b02a2a 100%);
}

/* === 结果区域 (适用于 DOH 和 ASN) === */
pre {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    overflow-x: auto;
    max-height: 400px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap; /* For ASN tool to wrap long lines */
}

/* === ASN 特定样式 === */
.format-options {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.format-option {
    display: flex;
    align-items: center;
}

.format-option input {
    margin-right: 8px;
}

.stats {
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
    margin-top: 5px;
}

.examples {
    background: #f0fff4;
    border-left: 4px solid #48bb78;
    padding: 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 30px;
}

.examples h3 {
    margin-bottom: 15px;
    color: #2d3748;
}

.example-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.example-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.example-input, .example-output {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: #f7fafc;
    padding: 10px;
    border-radius: 4px;
    margin: 8px 0;
}

/* === 通知 === */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(200%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #38a169 100%);
}

.notification.error {
    background: linear-gradient(135deg, var(--error-color) 0%, #c53030 100%);
}

.notification.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #dd6b20 100%);
}

/* === 底部 === */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: var(--secondary-color);
    font-size: 0.9rem;
}