/* style.css */
/* 全局重置和基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    padding: 10px;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* 标题 */
h2, h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* 导航栏 */
nav {
    background-color: #34495e;
    padding: 10px;
    margin: 20px 0;
    border-radius: 5px;
    text-align: center;
}
nav a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 4px;
    display: inline-block;
}
nav a:hover {
    background-color: #2c3e50;
}

/* 表单和字段组 */
form {
    background-color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
fieldset {
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fafafa;
}
legend {
    font-weight: bold;
    color: #2c3e50;
    padding: 0 5px;
}
input[type="text"], input[type="date"], input[type="tel"], input[type="email"], textarea, select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
button, input[type="submit"] {
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}
button:hover, input[type="submit"]:hover {
    background-color: #2980b9;
}

/* 消息提示 */
.message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}
.message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
th {
    background-color: #34495e;
    color: white;
}
tr:nth-child(even) {
    background-color: #f2f2f2;
}
tr:hover {
    background-color: #f5f5f5;
}
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    body {
        padding: 5px;
    }
    .container {
        padding: 10px;
    }
    nav a {
        display: block;
        margin: 5px 0;
        width: calc(100% - 20px);
        margin-left: auto;
        margin-right: auto;
    }
    table, thead, tbody, th, td, tr {
        display: block;
    }
    th, td {
        /* Behave like a "row" */
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    th:before, td:before {
        /* Create a label before each cell */
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%;
        text-align: left;
        font-weight: bold;
        color: #34495e;
    }
    /* Hide the first column's label in thead */
    thead tr th:first-child:before {
        display: none;
    }
    /* For the first data row, show the ID */
    tbody tr td:first-child:before {
        content: "ID: ";
    }
}