* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1d2e 0%, #0c0e14 100%);
    min-height: 100vh;
    color: #e7e7f0;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #bf9cff;
    font-size: 28px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #a0a0b0;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #bf9cff;
    box-shadow: 0 0 0 3px rgba(191, 156, 255, 0.2);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #bf9cff 0%, #9b6dff 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(191, 156, 255, 0.3);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-msg {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
}

.sidebar h2 {
    color: #bf9cff;
    font-size: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    color: #a0a0b0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(191, 156, 255, 0.1);
    color: #bf9cff;
}

.nav-item.logout {
    margin-top: 40px;
    color: #e74c3c;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page-title {
    font-size: 24px;
    margin-bottom: 30px;
    color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card .label {
    color: #a0a0b0;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: #bf9cff;
}

.table-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px;
    text-align: left;
}

th {
    background: rgba(0, 0, 0, 0.2);
    color: #a0a0b0;
    font-weight: 500;
    font-size: 14px;
}

td {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bf9cff, #9b6dff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.badge-pro {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.badge-normal {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.badge-virtual {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    margin-right: 8px;
}

.btn-view {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.btn-delete {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    width: 300px;
}

.search-box button {
    padding: 10px 20px;
    background: #bf9cff;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #a0a0b0;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
}

.pagination button.active {
    background: #bf9cff;
    border-color: #bf9cff;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 用户详情弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1d2e;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #bf9cff;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: #a0a0b0;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.user-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bf9cff, #7c4dff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    font-weight: bold;
}

.user-detail-info h3 {
    color: #e7e7f0;
    font-size: 20px;
    margin-bottom: 8px;
}

.user-detail-info p {
    color: #a0a0b0;
    font-size: 14px;
    margin: 4px 0;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    color: #bf9cff;
    font-size: 16px;
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #bf9cff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #a0a0b0;
}

.dream-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dream-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dream-title {
    color: #e7e7f0;
    font-weight: bold;
    margin-bottom: 6px;
}

.dream-content {
    color: #a0a0b0;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.dream-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #808090;
}

.subscription-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    color: #ffd700;
    font-size: 14px;
}

.empty-text {
    color: #a0a0b0;
    text-align: center;
    padding: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.info-grid div {
    color: #a0a0b0;
    font-size: 14px;
}

.info-grid strong {
    color: #bf9cff;
}

.status-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-success {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.tag-default {
    background: rgba(149, 165, 166, 0.2);
    border-color: rgba(149, 165, 166, 0.3);
    color: #95a5a6;
}

.dream-content-full {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 16px;
    color: #e7e7f0;
    line-height: 1.8;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-all;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-list .tag {
    background: rgba(191, 156, 255, 0.15);
    border-color: rgba(191, 156, 255, 0.3);
    color: #bf9cff;
}

/* 订阅管理 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card-large {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card-large .stat-label {
    color: #a0a0b0;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card-large .stat-value {
    color: #bf9cff;
    font-size: 36px;
    font-weight: bold;
}

/* 系统设置 */
.settings-container {
    max-width: 900px;
}

.settings-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-section h3 {
    color: #bf9cff;
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: #a0a0b0;
    font-size: 14px;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #e7e7f0;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #bf9cff;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.settings-actions {
    text-align: center;
    padding: 20px;
}

.save-btn {
    background: linear-gradient(135deg, #bf9cff, #7c4dff);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(191, 156, 255, 0.4);
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.msg-box {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.msg-box.success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.msg-box.error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.hidden {
    display: none !important;
}
