:root {
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --secondary-color: #f8f9fa;
    --secondary-hover: #e2e6ea;
    --danger-color: #e74c3c;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-sub: #7f8c8d;
    --border-color: #dcdde1;
    
    /* 角色颜色 */
    --role-host: #e74c3c; /* 主陪 */
    --role-guest: #f1c40f; /* 主宾 */
    --role-cohost: #e67e22; /* 副陪 */
    --role-other: #3498db; /* 其他 */
    
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    color: var(--text-main);
}

/* Header */
.app-header {
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}
.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn.secondary:hover {
    background-color: var(--secondary-hover);
    border-color: #cbd5e0;
}

.btn.danger {
    background-color: #fff;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}
.btn.danger:hover {
    background-color: #fff5f5;
}

/* Main Layout */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4rem; /* 桌子之间的间距 */
}

/* Table Wrapper */
.table-wrapper {
    position: relative;
    /* 容器大小根据内容自适应，但我们会给一个最小尺寸 */
    min-width: 400px;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

/* Table Center */
.table-surface {
    width: 180px;
    height: 180px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border: 8px solid #eef2f7;
    cursor: pointer;
    transition: transform 0.3s;
    position: relative;
}

.table-surface:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.table-surface:hover::after {
    content: '\f013'; /* FontAwesome Cog */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.table-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 4px;
}

.seat-count-display {
    font-size: 0.9rem;
    color: var(--text-sub);
}

/* Seats */
.seat {
    position: absolute;
    width: 90px; /* 座位卡片宽度 */
    /* 高度自适应 */
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

.seat-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 4px;
    width: 100%;
    transition: all 0.2s;
    position: relative;
    border-top: 3px solid var(--role-other);
}

.seat-card:focus-within {
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    transform: translateY(-2px);
}

/* Role Label */
.role-badge {
    font-size: 10px;
    text-align: center;
    margin-bottom: 2px;
    padding: 1px 4px;
    border-radius: 3px;
    color: #fff;
    background: var(--role-other);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Role Colors */
.seat-card[data-role-type="host"] { border-color: var(--role-host); }
.seat-card[data-role-type="host"] .role-badge { background: var(--role-host); }

.seat-card[data-role-type="cohost"] { border-color: var(--role-cohost); }
.seat-card[data-role-type="cohost"] .role-badge { background: var(--role-cohost); }

.seat-card[data-role-type="guest"] { border-color: var(--role-guest); }
.seat-card[data-role-type="guest"] .role-badge { background: var(--role-guest); color: #333; }

.seat-input {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    padding: 4px 2px;
    outline: none;
    background: transparent;
}
.seat-input:hover {
    background: #f8f9fa;
}
.seat-input:focus {
    background: #fff;
    border-color: #e2e6ea;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-sub);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.number-input input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
    font-size: 1.1rem;
}

.num-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}
.num-btn:hover {
    background: var(--bg-color);
}

.form-info {
    background: #e3f2fd;
    color: #1976d2;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.footer-right {
    display: flex;
    gap: 10px;
}

/* Rule Modal Specifics */
.rule-modal-content {
    max-width: 800px;
    width: 95%;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.rule-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.rule-tabs {
    width: 120px;
    background: #f8f9fa;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.rule-tab {
    padding: 12px 15px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
    font-size: 14px;
}

.rule-tab:hover {
    background: #e9ecef;
}

.rule-tab.active {
    background: #fff;
    color: var(--primary-color);
    font-weight: bold;
    border-left: 3px solid var(--primary-color);
}

.rule-content {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    line-height: 1.6;
}

.rule-content h3 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.rule-content h4 {
    margin: 20px 0 10px;
    color: var(--text-main);
}

.rule-content ul {
    padding-left: 20px;
    color: #555;
}

.rule-content li {
    margin-bottom: 8px;
}

.rule-tag {
    display: inline-block;
    padding: 2px 6px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
}
