/* 全局样式 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 导航栏样式 */
.nav-container {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-left {
    flex: 1;
    justify-content: flex-start;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.refresh-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.countdown {
    font-family: monospace;
}

.refresh-button {
    color: #1a73e8;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.refresh-button:hover {
    background: #f0f4fe;
}

/* 导航链接样式 */
.nav-link {
    color: #666;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #1a73e8;
    background-color: #f0f4fe;
}

.nav-link.active {
    color: #1a73e8;
    font-weight: 500;
    background-color: #f0f4fe;
}

/* 导航项目样式 */
.nav li {
    margin: 0 8px;
}

/* 导航容器样式补充 */
.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 刷新信息区域样式调整 */
.refresh-info {
    background: #f8f9fa;
    border: 1px solid #eef0f5;
}

/* 响应式调整补充 */
@media (max-width: 768px) {
    .nav li {
        margin: 0 4px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nav-wrapper {
        flex-direction: column;
        padding: 10px;
    }
    
    .nav-left {
        margin-bottom: 10px;
    }
}

/* 内容区域 */
.container {
    margin-top: 80px;
    padding: 20px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* 卡片容器 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    width: 100%;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #eef0f5;
    position: relative;
    perspective: 2000px;
    cursor: pointer;
    height: 220px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 卡片内部容器 */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* 翻转效果 */
.card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* 卡片正面和背面的共同样式 */
.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

/* 卡片正面 */
.card-front {
    transform: rotateY(0);
    background: linear-gradient(to bottom, white, #fafafa);
}

.card-front h2 {
    margin-top: 45px;
    margin-bottom: 12px;
}

.card-front p {
    margin: 4px 0;
}

/* 更新时间信息的容器 */
.card-info-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 更新时间样式 */
.update-time {
    font-size: 13px;
    color: #666;
}

/* 翻转提示 */
.flip-hint {
    position: absolute;
    bottom: 12px;
    width: 100%;
    text-align: center;
    color: #999;
    font-size: 12px;
    left: 0;
}

/* 卡片背面 */
.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(to bottom, #f8f9fa, #f0f2f5);
}

/* 状态标签样式 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    position: absolute;
    top: 15px;
    right: 15px;
}

.status-badge.available {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.borrowed {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-badge.unavailable {
    background-color: #ffebee;
    color: #c62828;
}

/* 调整卡片内容布局 */
.card-front h2 {
    margin-top: 45px; /* 为状态标签留出空间 */
}

/* 卡片内容样式 */
.card h2 {
    font-size: 16px;
    margin-bottom: 12px;
    padding-right: 25px;
    color: #2c3e50;
}

.card h3 {
    font-size: 15px;
    margin-bottom: 10px;
    color: #1a73e8;
}

.card p {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
}

/* 手机号码样式 */
.phone-number {
    cursor: pointer;
    color: #1a73e8;
    text-decoration: underline;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
}

.phone-number:hover {
    color: #1557b0;
}

.phone-number:focus-visible {
    outline: 2px solid rgba(26, 115, 232, 0.28);
    outline-offset: 2px;
    border-radius: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card {
        height: 240px; /* 稍微增加卡片高度 */
    }

    .card-front {
        padding: 16px;
    }

    .card-front h2 {
        margin-top: 40px;
        font-size: 15px;
    }

    .card-front p {
        font-size: 13px;
    }

    .card-info-bottom {
        gap: 6px;
    }

    .update-time {
        font-size: 12px;
    }

    .flip-hint {
        padding-top: 6px;
        font-size: 11px;
    }
}

/* 表格样式 */
table {
    width: 100%;
    background: white;
    border-radius: 12px;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-top: 20px;
}

th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 500;
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eef0f5;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #eef0f5;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav {
        padding: 0 10px;
        height: 50px;
    }

    .nav li {
        margin: 0 5px;
    }

    .nav a {
        padding: 6px 12px;
        font-size: 14px;
    }

    .container {
        margin-top: 60px;
        padding: 10px;
    }

    .card-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }

    .card {
        height: 200px;
    }

    .card-front,
    .card-back {
        padding: 15px;
    }

    .refresh-container {
        top: 8px;
        right: 10px;
        padding: 5px 10px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th, td {
        padding: 10px;
    }
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: all 0.3s ease;
    opacity: 0;
}

.modal.show {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: scale(0.8) translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 弹窗消失动画 */
.modal.hide {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    opacity: 0;
}

.modal.hide .modal-content {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
}

.modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 500;
}

.modal-content.error {
    text-align: center;
    padding: 20px;
    animation: shake 0.5s ease-in-out;
}

.modal-content.error h3 {
    color: #dc2626;
    margin-bottom: 8px;
}

.modal-content.error p {
    color: #666;
    margin: 0;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 14px;
}

#password-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

#password-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin-top: 24px;
}

.modal-buttons button {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm {
    background: #1a73e8;
    color: white;
    border: none;
}

.btn-confirm:hover {
    background: #1557b0;
}

.btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: none;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 历史记录容器 */
.history-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
    padding: 20px;
}

/* 历史记录卡片 */
.history-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.history-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.history-card-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-bottom: 1px solid #eef0f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-card-header h2 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-badge.available {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.borrowed {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-badge.unavailable {
    background-color: #ffebee;
    color: #c62828;
}

/* 时间线样式 */
.history-timeline {
    padding: 20px;
}

.history-item {
    position: relative;
    padding-left: 28px;
    margin-bottom: 24px;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 24px;
    bottom: -24px;
    width: 2px;
    background: #e1e8ed;
}

.history-item:last-child::before {
    display: none;
}

.history-time {
    margin-bottom: 8px;
    color: #666;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.time-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 4px;
}

.borrow-record .time-dot {
    background: #ff9500;
    box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.2);
}

.return-record .time-dot {
    background: #34c759;
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.2);
}

.history-content {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}

.history-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.history-type {
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 12px;
}

.borrow-record .history-type {
    background: #fff3e0;
    color: #f57c00;
}

.return-record .history-type {
    background: #e8f5e9;
    color: #2e7d32;
}

.history-name {
    font-weight: 500;
    color: #2c3e50;
    margin-right: 12px;
}

.history-purpose,
.history-status {
    color: #666;
    font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .history-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px;
    }

    .history-card-header {
        padding: 15px;
    }

    .history-timeline {
        padding: 15px;
    }
}

/* 展开按钮样式 */
.expand-button {
    text-align: center;
    padding: 12px;
    margin-top: 8px;
    cursor: pointer;
    color: #1a73e8;
    font-size: 14px;
    transition: all 0.3s ease;
}

.expand-text {
    position: relative;
    display: inline-block;
}

.expand-icon {
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.3s ease;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* 隐藏记录的动画 */
.hidden-records {
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

/* 提示动画 */
.history-timeline.has-more {
    position: relative;
}

.history-timeline.has-more::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-card:hover .history-timeline.has-more::after {
    opacity: 1;
}

/* 展开/收起动画 */
.hidden-records {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.hidden-records[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* 遮罩层样式 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 历史记录卡片激活状态 */
.history-card {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease, z-index 0s;
}

.history-card.active {
    z-index: 101;
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

/* 修改卡片标题区域样式 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h2 {
    margin: 0;
    padding-right: 0;
    font-size: 16px;
    flex: 1;
}

/* 调整状态标签样式 */
.status-badge {
    position: static;  /* 移除绝对定位 */
    margin-left: 10px;
}

/* 调整卡片内容布局 */
.card-front h2 {
    margin-top: 0;  /* 移除顶部边距 */
}

/* 页脚样式 */
.footer {
    background: #fff;
    padding: 40px 0 20px;
    margin-top: 60px;
    border-top: 1px solid #eef0f5;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-section {
    padding: 0 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
}

.footer-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.footer-section h3 {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-links,
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li,
.footer-contact li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #1a73e8;
}

.footer-entry-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(26, 115, 232, 0.08);
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.footer-entry-link:hover {
    background: rgba(26, 115, 232, 0.14);
    box-shadow: 0 10px 24px rgba(26, 115, 232, 0.12);
    transform: translateY(-1px);
}

.footer-entry-link:active {
    transform: translateY(0);
}

.footer-contact li {
    color: #666;
    font-size: 14px;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eef0f5;
}

.footer-bottom p {
    color: #999;
    font-size: 13px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        padding: 0;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }
}

#password-input.error {
    border-color: #dc2626 !important;
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }

    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* 联系信息弹窗样式 */
.contact-dialog {
    width: 360px;
    text-align: center;
}

.contact-info {
    background: #f5f7fa;
    border-radius: 16px;
    padding-left: 25px;
    margin: 20px 0;
}

.info-row {
    display: flex;
    flex-direction: column;
}

.info-item {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}
.info-value {
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    padding: 12px 24px;
    border-radius: 12px;
}

.info-label {
    font-size: 15px;
    font-weight: 500;
    color: #888888;
}

.modal-buttons {
    justify-content: center;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

.hidden {
    display: none !important;
}

.notice.info {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

.notice.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.notice.error {
  background: #fee;
  color: #c33;
  border: 1px solid #f3c6c6;
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

/* 统计页面样式 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    padding: 20px;
}

.stats-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.stats-card h2 {
    margin: 0 0 20px;
    color: #2c3e50;
    font-size: 18px;
    text-align: center;
}

.chart-container {
    height: 500px;
    width: 100%;
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px;
    }

    .chart-container {
        height: 400px;
    }
}

.admin-body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fa;
    line-height: 1.6;
    color: #333;
}

.admin-nav-container {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.admin-nav-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-right: 20px;
}

.admin-nav-badge {
    background: #1a73e8;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.admin-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-save {
    background: #1a73e8;
    color: white;
}

.btn-save:hover {
    background: #1557b0;
    transform: translateY(-1px);
}

.btn-logout {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #eef0f5;
}

.btn-logout:hover {
    background: #e8eaed;
}


.admin-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-settings-header h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #2c3e50;
}

.admin-settings-header p {
    margin: 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.7;
}

.admin-settings-meta {
    color: #1a73e8;
    background: #f0f4fe;
    border: 1px solid #d6e4ff;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.admin-settings-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.admin-settings-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.admin-settings-modal-content {
    width: min(560px, calc(100vw - 32px));
    border-radius: 20px;
    padding: 28px;
}

.admin-settings-header-modal {
    margin-bottom: 20px;
}

.info-box {
    background: #e3f2fd;
    color: #1565c0;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid #bbdefb;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    border: 1px solid #c8e6c9;
}

.admin-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #eef0f5;
}

.device-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #eef0f5;
    padding: 20px;
    cursor: move;
    transition: all 0.3s ease;
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.device-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.device-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.device-card.drag-over {
    border: 2px dashed #1a73e8;
    background: #f0f4fe;
}

.drag-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #999;
    font-size: 20px;
    cursor: move;
}

.device-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-right: 30px;
}

.device-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-info-item {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.device-info-label {
    color: #999;
    min-width: 70px;
}

.device-id {
    font-size: 12px;
    color: #999;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* 登录页保留当前主题 */
.login-page {
  min-height: 100vh;
  padding: 48px 20px 60px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.08), transparent 30%),
    #f5f7fa;
}

.login-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: stretch;
}

.login-intro,
.themed-login-card {
  background: #fff;
  border: 1px solid #eef0f5;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.login-intro {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-intro::after {
  content: '';
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(26, 115, 232, 0.16), rgba(26, 115, 232, 0));
  border-radius: 50%;
}

.login-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.login-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f0f4fe;
  color: #1a73e8;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0;
}

.login-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(26, 115, 232, 0.16);
  background: rgba(255, 255, 255, 0.86);
  color: #1a73e8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-home-link:hover {
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.12);
  transform: translateY(-1px);
}

.login-home-link:active {
  transform: translateY(0);
}

.login-intro h1 {
  margin: 0 0 16px;
  font-size: 40px;
  line-height: 1.15;
  color: #2c3e50;
}

.login-intro p {
  margin: 0;
  color: #5f6b7a;
  font-size: 16px;
  line-height: 1.8;
  max-width: 520px;
}

.login-feature-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.login-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #475569;
  font-size: 15px;
}

.login-feature-dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: #1a73e8;
  box-shadow: 0 0 0 6px rgba(26, 115, 232, 0.12);
}

.themed-login-card {
  padding: 34px;
}

.login-card-header {
  margin-bottom: 22px;
}

.login-card-header h2 {
  margin: 0 0 8px;
  color: #2c3e50;
  font-size: 28px;
}

.login-card-header p {
  margin: 0;
  color: #667085;
  font-size: 14px;
}

.themed-form-grid {
  display: grid;
  gap: 18px;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.input {
  width: 100%;
}

.themed-input {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid #d9e1ea;
  background: #fbfdff;
  transition: all 0.2s ease;
}

.themed-input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
  background: #fff;
}

.themed-login-btn {
  margin-top: 4px;
  padding: 13px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1a73e8 0%, #5a8cff 100%);
  box-shadow: 0 8px 20px rgba(26, 115, 232, 0.2);
  color: white;
}

.notice.info {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

.notice.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.notice.error {
  background: #fee;
  color: #c33;
  border: 1px solid #f3c6c6;
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

@media (max-width: 960px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-kicker-row {
        align-items: flex-start;
    }

    .admin-settings-header {
        flex-direction: column;
    }

    .admin-settings-meta {
        white-space: normal;
    }

    .admin-settings-form {
        grid-template-columns: 1fr;
    }

    .admin-settings-actions {
        justify-content: stretch;
    }

    .admin-settings-actions .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .nav li {
        margin: 0 4px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 14px;
    }

    .container {
        margin-top: 60px;
        padding: 10px;
    }

    .card-container,
    .admin-card-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }

    .card {
        height: 240px;
    }

    .stats-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px;
    }

    .chart-container {
        min-height: 400px;
    }

    .history-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px;
    }

    .history-card-header {
        padding: 15px;
    }

    .history-timeline {
        padding: 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-section {
        padding: 0;
    }

    .nav-wrapper,
    .admin-nav-wrapper {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 10px;
    }

    .container {
        margin-top: 120px;
        padding: 15px;
    }
}

.load-state {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: min(100%, 560px);
    margin: 0 auto;
    padding: 40px 28px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(88, 160, 255, 0.18);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(88, 160, 255, 0.12);
    text-align: center;
    box-sizing: border-box;
}

.card-container > .load-state,
.history-container > .load-state {
    grid-column: 1 / -1;
    justify-self: center;
}

.chart-container > .load-state {
    width: 100%;
    max-width: none;
    min-height: 100%;
    height: 100%;
    margin: 0;
}

.load-state-loading {
    color: #1a73e8;
}

.load-state-ready .load-lottie {
    opacity: 1;
    transform: scale(1);
}

.load-state-ready .load-fallback {
    opacity: 0;
}

.load-state-error {
    color: #c62828;
}

.load-visual {
    position: relative;
    width: 168px;
    height: 168px;
    display: grid;
    place-items: center;
    margin: 0 auto 6px;
}

.load-lottie {
    width: 168px;
    height: 168px;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.load-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: opacity 0.24s ease;
}

.load-fallback-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7cb8ff 0%, #1a73e8 100%);
    box-shadow: 0 10px 24px rgba(26, 115, 232, 0.22);
    animation: load-dot-wave 1.2s ease-in-out infinite;
}

.load-fallback-dot:nth-child(2) {
    animation-delay: 0.16s;
}

.load-fallback-dot:nth-child(3) {
    animation-delay: 0.32s;
}

.load-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2d3d;
}

.load-subtitle {
    font-size: 14px;
    color: #667085;
    max-width: 360px;
    line-height: 1.7;
}

.load-icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: rgba(198, 40, 40, 0.12);
    box-shadow: 0 12px 28px rgba(198, 40, 40, 0.12);
    color: #c62828;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 700;
}

@keyframes load-dot-wave {
    0%,
    80%,
    100% {
        transform: translateY(0) scale(0.88);
        opacity: 0.42;
    }
    40% {
        transform: translateY(-12px) scale(1.08);
        opacity: 1;
    }
}
