/* ========================================
   计算机网络课程实验平台 - 统一样式表
   简洁、干净、技术感风格
   版本: 1.0
   适用页面: index.html, static.html, network-test.php,
            form.html, get.php, post.php, status/error.php
   ======================================== */

/* ----------------------------------------
   重置与基础设置
   ---------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: #f5f7fa;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1e2a3a;
    line-height: 1.5;
    padding: 2rem 1rem;
    min-height: 100vh;
}

/* ----------------------------------------
   内容容器
   ---------------------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    padding: 2rem 2rem 2.5rem;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .container {
        padding: 1.5rem;
        border-radius: 12px;
    }
}

/* ----------------------------------------
   标题排版
   ---------------------------------------- */
h1 {
    font-size: 2.2rem;
    font-weight: 600;
    text-align: center;
    color: #1d1d1f;
    margin: 0 0 1rem 0;
    letter-spacing: -0.3px;
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 1.7rem;
    font-weight: 500;
    color: #1d1d1f;
    margin-top: 1.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e5e7eb;
}

h3 {
    font-size: 1.35rem;
    font-weight: 500;
    color: #2c3e50;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

h4, h5, h6 {
    color: #2c3e50;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* ----------------------------------------
   链接与按钮
   ---------------------------------------- */
a {
    color: #0071e3;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #005bb5;
    text-decoration: underline;
}

.btn,
button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
    display: inline-block;
    background-color: #0071e3;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    min-width: 96px;
    line-height: 1.4;
}

a.btn {
    text-decoration: none;
    background-color: #0071e3;
    color: white;
}

a.btn:hover,
.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover {
    background-color: #005bb5;
    text-decoration: none;
}

.btn:active,
button:active {
    background-color: #004a99;
}

.btn-secondary {
    background-color: #4a627a;
}

.btn-secondary:hover {
    background-color: #364b60;
}

.btn:disabled,
button:disabled,
input:disabled {
    background-color: #9aaebf;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ----------------------------------------
   表单元素
   ---------------------------------------- */
label {
    font-weight: 500;
    margin-bottom: 0.35rem;
    display: inline-block;
    color: #1e2a3a;
}

input:not([type="submit"]):not([type="reset"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #ffffff;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1rem;
    color: #1e2a3a;
}

input:not([type="submit"]):not([type="reset"]):not([type="button"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
    margin-bottom: 0;
    transform: scale(1.05);
    vertical-align: middle;
}

fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

legend {
    font-weight: 600;
    padding: 0 0.5rem;
    color: #1d1d1f;
}

.form-group {
    margin-bottom: 1.25rem;
}

.error-message,
.form-error {
    color: #c7362b;
    background-color: #ffe6e5;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid #c7362b;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.success-message {
    color: #2b6e3c;
    background-color: #e1f7e8;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid #2b6e3c;
    margin: 1rem 0;
}

/* ----------------------------------------
   表格样式
   ---------------------------------------- */
.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

th, td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e9edf2;
}

th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 0.95rem;
}

tr:hover {
    background-color: #fafcff;
}

tbody tr:nth-child(even) {
    background-color: #fcfdfe;
}

table a {
    word-break: break-word;
}

/* ----------------------------------------
   代码与技术内容
   ---------------------------------------- */
code, pre, .code-block {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9rem;
    background-color: #f2f5f9;
    border-radius: 8px;
}

code {
    padding: 0.2rem 0.4rem;
    background-color: #eef2f6;
    color: #1f5e7e;
    border: 1px solid #e2e8f0;
}

pre {
    background-color: #1e2a36;
    color: #e2e8f0;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 12px;
    margin: 1rem 0;
    line-height: 1.45;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: 0.85rem;
}

.terminal {
    background-color: #0f1720;
    color: #cbd5e6;
    padding: 1rem;
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.85rem;
    margin: 1rem 0;
    border-left: 3px solid #0071e3;
}

/* ----------------------------------------
   列表样式
   ---------------------------------------- */
ul, ol {
    margin: 0.5rem 0 1rem 1.5rem;
}

li {
    margin: 0.3rem 0;
}

/* ----------------------------------------
   辅助布局
   ---------------------------------------- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.card-inset {
    background-color: #fafcff;
    border: 1px solid #eef2f8;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
    margin: 1.5rem 0;
}

/* ----------------------------------------
   响应式调整
   ---------------------------------------- */
@media (max-width: 640px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.45rem;
    }

    .btn, button, input[type="submit"] {
        padding: 0.55rem 1rem;
        min-width: 80px;
    }

    .container {
        padding: 1.2rem;
    }

    th, td {
        padding: 0.7rem 0.8rem;
    }
}

/* ----------------------------------------
   打印样式
   ---------------------------------------- */
@media print {
    body {
        background-color: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }

    .btn, button, .no-print {
        display: none;
    }

    a {
        text-decoration: underline;
    }
}