/* Shared CSS for the entire application */

/* Basic Reset & Box-Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body and Typography Defaults */
body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333333;
    background-color: #f4f7f6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    margin-top: 0;
    margin-bottom: 0.8em;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2.8em; }
h2 { font-size: 2.2em; }
h3 { font-size: 1.8em; }
h4 { font-size: 1.5em; }
h5 { font-size: 1.25em; }
h6 { font-size: 1em; }

p {
    margin-bottom: 1em;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes extra space below image */
    vertical-align: middle;
}

/* Lists */
ul, ol {
    margin-left: 25px;
    margin-bottom: 1em;
    list-style-type: disc;
}

li {
    margin-bottom: 0.5em;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 16px;
    color: #333;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    appearance: none; /* Remove default browser styling */
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

/* Buttons */
button, .btn {
    display: inline-block;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: #007bff;
    border: 1px solid #007bff;
    padding: 10px 20px;
    font-size: 16px;
    line-height: 1.5;
    border-radius: 4px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
    -webkit-appearance: none; /* For Safari/iOS */
    -moz-appearance: none; /* For Firefox */
    appearance: none;
}

button:hover, .btn:hover {
    color: #ffffff;
    background-color: #0056b3;
    border-color: #004a99;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active, .btn:active {
    background-color: #003f7f;
    border-color: #003566;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.btn-secondary {
    color: #ffffff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #ffffff;
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-success {
    color: #ffffff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    color: #ffffff;
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    color: #ffffff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    color: #ffffff;
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-outline-primary {
    color: #007bff;
    background-color: transparent;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    color: #ffffff;
    background-color: #007bff;
    border-color: #007bff;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.hidden { display: none !important; }
.visually-hidden, .sr-only { /* For accessibility */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Layout helpers */
.flex-container {
    display: flex;
}

.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.justify-content-start { justify-content: flex-start; }
.justify-content-end { justify-content: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }

.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.align-items-center { align-items: center; }
.align-items-stretch { align-items: stretch; }
.align-items-baseline { align-items: baseline; }

.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.gap-30 { gap: 30px; }

.margin-top-20 { margin-top: 20px; }
.margin-bottom-20 { margin-bottom: 20px; }
.padding-20 { padding: 20px; }

/* Cards */
.card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.card-body {
    font-size: 0.95em;
    line-height: 1.7;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden; /* For rounded corners */
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 0.9em;
}

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

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

/* Alerts and Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 500;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Accessibility focus styles */
:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
    border-radius: 3px;
}

/* Main content area styling */
.main-content {
    flex: 1; /* Allows content to grow and push footer down */
    padding: 30px 0;
}

/* Media Queries for general responsiveness */
@media (max-width: 992px) {
    h1 { font-size: 2.5em; }
    h2 { font-size: 2em; }
    h3 { font-size: 1.6em; }
    .container {
        padding: 0 15px;
    }
    .card {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    body { font-size: 15px; }
    h1 { font-size: 2.2em; }
    h2 { font-size: 1.8em; }
    h3 { font-size: 1.4em; }
    button, .btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    input[type="text"], input[type="email"], input[type="password"], textarea, select {
        padding: 8px 10px;
        font-size: 14px;
    }
    th, td {
        padding: 10px 12px;
    }
    .main-content {
        padding: 20px 0;
    }
}

@media (max-width: 576px) {
    h1 { font-size: 2em; }
    h2 { font-size: 1.6em; }
    h3 { font-size: 1.2em; }
    .card {
        padding: 15px;
    }
    ul, ol { margin-left: 15px; }
    .container { padding: 0 10px; }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
