/*
 * RAMSAY 样式表
 */

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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 头部样式 */
header {
    background-color: #343a40;
    color: #fff;
    padding: 15px 0;
}

header h1 {
    margin: 0;
    font-size: 24px;
}

header h1 a {
    color: #fff;
    text-decoration: none;
}

header nav {
    margin-top: 10px;
}

header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

header nav li {
    margin-right: 20px;
}

header nav li:last-child {
    margin-right: 0;
}

header nav a {
    color: #fff;
    text-decoration: none;
}

header nav a:hover {
    text-decoration: underline;
}

.user-info {
    margin-left: auto;
}

.user-info span {
    margin-right: 10px;
}

/* 主要内容样式 */
main {
    padding: 30px 0;
    flex: 1;
}

h2 {
    margin-bottom: 20px;
    color: #343a40;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

textarea {
    height: 150px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background-color: #0069d9;
}

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

.btn-secondary:hover {
    background-color: #5a6268;
}

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

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

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.card-body {
    padding: 15px;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 15px;
    border-top: 1px solid #ddd;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* 投票操作按钮样式 */
.vote-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}

.vote-actions form {
    display: inline-block;
    margin-right: 5px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

/* 警告框样式 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

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

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

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

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
}

.pagination li {
    margin: 0 5px;
}

.pagination a {
    display: block;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    text-decoration: none;
}

.pagination .active a {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
    cursor: default;
}

/* 每页显示数量选择器样式 */
.per-page-selector {
    display: flex;
    align-items: center;
}

.per-page-selector label {
    margin-right: 10px;
    margin-bottom: 0;
    font-weight: normal;
}

.per-page-selector select {
    width: auto;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

/* 弹性布局工具类 */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* 卡片网格样式 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.card-item {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-item img {
    width: 100%;
    height: auto;
}

.card-item-body {
    padding: 15px;
}

.card-item-title {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
}

/* 禁限状态样式 */
.forbidden {
    color: #dc3545;
    font-weight: bold;
}

.limited {
    color: #fd7e14;
    font-weight: bold;
}

.semi-limited {
    color: #ffc107;
    font-weight: bold;
}

.unlimited {
    color: #28a745;
}

/* 当前禁限状态样式 */
.current-limit-status {
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 5px solid #007bff;
}

.current-limit-status p {
    margin: 0;
    font-size: 18px;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 5px;
}

.status-badge.forbidden {
    background-color: #f8d7da;
}

.status-badge.limited {
    background-color: #fff3cd;
}

.status-badge.semi-limited {
    background-color: #fff3cd;
}

.status-badge.unlimited {
    background-color: #d4edda;
}

/* 变化类型标签样式 */
.change-type {
    display: inline-block;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 10px;
}

.further-restriction {
    background-color: #f8d7da;
    color: #721c24;
}

.no-change {
    background-color: #e2e3e5;
    color: #383d41;
}

.relaxed-restriction {
    background-color: #d4edda;
    color: #155724;
}

/* 投票样式 */
.vote-info {
    margin-bottom: 20px;
}

.vote-stats {
    display: flex;
    margin-bottom: 20px;
}

.vote-stat-item {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.vote-stat-item:last-child {
    margin-right: 0;
}

.vote-stat-count {
    font-size: 24px;
    font-weight: bold;
}

.vote-records {
    margin-top: 20px;
}

.vote-record {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.vote-record:last-child {
    border-bottom: none;
}

.vote-record-user {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.vote-record-identifier {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    font-size: 0.85em;
    padding: 2px 6px;
    border-radius: 10px;
    margin: 0 8px;
    font-family: monospace;
    letter-spacing: 0.5px;
}

.vote-record-time {
    color: #6c757d;
    font-size: 0.85em;
}

/* 页脚样式 */
footer {
    background-color: #343a40;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* 作者光荣榜样式 */
.table-responsive {
    overflow-x: auto;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

.table-danger {
    background-color: #f8d7da;
}

.table-danger:hover {
    background-color: #f5c6cb;
}

/* 响应式样式 */
@media (max-width: 768px) {
    header nav ul {
        flex-direction: column;
    }

    header nav li {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .vote-stats {
        flex-direction: column;
    }

    .vote-stat-item {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.dropdown-arrow {
    font-size: 0.8em;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #495057;
    min-width: 200px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 5px 0;
    margin-top: 5px;
    z-index: 1000;
    display: none;
    list-style: none;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 8px 15px;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: #6c757d;
    text-decoration: none;
}

.dropdown-divider {
    height: 1px;
    background-color: #6c757d;
    margin: 5px 0;
}
