/* 基本重置和全局样式 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa; /* 更柔和的背景色 */
    color: #212529;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    background-color: #ffffff;
    padding: 2.5rem 3rem;
    border-radius: 12px; /* 更大的圆角 */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    max-width: 800px; /* 适当加宽以容纳结果 */
    width: 100%;
    transition: all 0.3s ease;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

header .logo {
    color: #007bff;
    margin-bottom: 0.5rem;
}

header h1 {
    color: #343a40;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 2.25rem;
}

header p {
    color: #6c757d;
    font-size: 1rem;
}

/* 表单样式 */
#dns-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* 使用 gap 控制间距 */
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: #495057;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    background-color: #fff;
}

/* 按钮样式 */
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background-image: linear-gradient(to right, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
    min-height: 50px;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

button[type="submit"]:disabled {
    background-image: none;
    background-color: #a0c3e8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 加载动画 Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #fff;
    width: 22px;
    height: 22px;
    animation: spin 1s linear infinite;
}

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

/* 结果区域样式 */
.results-container {
    margin-top: 3rem;
}

.results-container h2 {
    color: #343a40;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

#results-display {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 100px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    overflow-x: auto;
    transition: background-color 0.3s ease;
}
/* 各种状态的样式 */
#results-display.success { background-color: #e6f7ff; border-color: #91d5ff; }
#results-display.error { background-color: #fff1f0; border-color: #ffccc7; }
#results-display.warning { background-color: #fffbe6; border-color: #ffe58f; }

/* 占位符和状态消息 */
.placeholder, .status-message {
    font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif; /* 非等宽字体 */
    color: #6c757d;
    text-align: center;
    padding: 1rem;
}
.status-message.error { color: #d93025; }
.status-message.warning { color: #f29900; }

/* 格式化结果的样式 */
.results-header {
    display: flex;
    font-weight: bold;
    color: #343a40;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #dee2e6;
    font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif; /* 表头用非等宽字体 */
}
.record-item {
    display: flex;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}
.record-item:last-child {
    border-bottom: none;
}

.col-name, .col-ttl, .col-type, .col-data {
    padding: 0 0.5rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.col-name { flex: 0 0 180px; color: #0056b3; }
.col-ttl { flex: 0 0 80px; color: #28a745; }
.col-type { flex: 0 0 80px; font-weight: bold; }
.col-data { flex: 1 1 auto; }

.record-part {
    display: inline-block;
    margin-right: 0.5rem;
}
.record-part strong {
    color: #6c757d;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.9em;
    color: #6c757d;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container { padding: 2rem 1.5rem; }
    header h1 { font-size: 1.8rem; }
    
    /* 在小屏幕上，让结果表单垂直堆叠 */
    .results-header { display: none; }
    .record-item { 
        flex-direction: column; 
        align-items: flex-start;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    .col-name, .col-ttl, .col-type, .col-data {
        flex-basis: auto;
        width: 100%;
        padding: 0.1rem 0;
    }
    .col-data::before, .col-ttl::before, .col-type::before {
        font-weight: bold;
        color: #343a40;
        font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    }
    .col-ttl::before { content: 'TTL: '; }
    .col-type::before { content: '类型: '; }
    .col-data::before { content: '数据: '; }
}