
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; color: #333; line-height: 1.6; }
.container { max-width: 600px; margin: 0 auto; padding: 20px; padding-bottom: 80px; }
.header { text-align: center; margin-bottom: 20px; }
.header h1 { color: white; font-size: 1.8rem; margin-bottom: 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.card { background: white; border-radius: 16px; padding: 25px; margin-bottom: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #555; }
.form-group input, .form-control { width: 100%; padding: 12px 16px; border: 2px solid #e1e5e9; border-radius: 8px; font-size: 16px; transition: border-color 0.3s; }
.form-group input:focus, .form-control:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); }
.btn { padding: 12px 24px; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; display: inline-block; text-decoration: none; text-align: center; min-height: 48px; line-height: 1.5; }
.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5a67d8; transform: translateY(-2px); }
.btn-success { background: #48bb78; color: white; }
.btn-success:hover { background: #38a169; }
.btn-danger { background: #f56565; color: white; padding: 8px 16px; font-size: 14px; min-height: 40px; }
.btn-danger:hover { background: #e53e3e; }
.member-list { margin-top: 20px; }
.member-item { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 16px; background: #f8f9fa; border-radius: 8px; border: 1px solid #e9ecef; }
.member-item input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid #dee2e6; border-radius: 6px; font-size: 14px; }
.member-item input:focus { border-color: #667eea; outline: none; }
.result-section { background: #f8f9fa; padding: 20px; border-radius: 12px; margin-top: 20px; }
.result-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; margin-bottom: 20px; }
.summary-item { text-align: center; padding: 15px; background: white; border-radius: 8px; border: 1px solid #e9ecef; }
.summary-item .value { font-size: 1.2rem; font-weight: 700; color: #667eea; }
.summary-item .label { font-size: 0.9rem; color: #6c757d; margin-top: 5px; }
.result-list { margin-top: 20px; }
.result-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: white; border-radius: 8px; margin-bottom: 8px; border: 1px solid #e9ecef; }
.result-item .name { font-weight: 600; }
.result-item .amount { font-weight: 700; font-size: 1.1rem; }
.result-item .positive { color: #28a745; }
.result-item .negative { color: #dc3545; }
.result-item .zero { color: #6c757d; }
.empty-state { text-align: center; padding: 40px 20px; color: #6c757d; }
.empty-state h3 { margin-bottom: 10px; font-size: 1.2rem; }
.floating-btn { position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; border-radius: 50%; background: #667eea; color: white; border: none; font-size: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); cursor: pointer; z-index: 1000; transition: all 0.3s; display: flex; justify-content: center; align-items: center; }
.floating-btn:hover { background: #5a67d8; transform: scale(1.1); }
.toast { position: fixed; top: 20px; right: 20px; background: #28a745; color: white; padding: 12px 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 1001; transform: translateX(100%); transition: transform 0.3s; }
.toast.show { transform: translateX(0); }
.toast.error { background: #dc3545; }
.loading { display: none; text-align: center; padding: 20px; }
.loading.show { display: block; }
.spinner { width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top: 4px solid #667eea; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 10px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.tabs { display: flex; background: rgba(255,255,255,0.25); padding: 5px; border-radius: 12px; margin-bottom: 20px; position: sticky; top: 10px; z-index: 100; backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.3); }
.tab-btn { flex: 1; text-align: center; padding: 12px; color: white; cursor: pointer; border-radius: 8px; font-weight: 600; transition: all 0.2s; opacity: 0.8; font-size: 1.1rem; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.tab-btn.active { background: white; color: #667eea; opacity: 1; box-shadow: 0 4px 12px rgba(0,0,0,0.15); transform: scale(1.02); text-shadow: none; }
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.ball-group-item { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; background: #f8f9fa; padding: 10px; border-radius: 8px; border: 1px solid #e9ecef; }
.ball-group-item input { flex: 1; margin: 0; border: 1px solid #ddd; }
.ball-group-item input:focus { border-color: #667eea; }
.ball-group-item .btn-danger { padding: 0 12px; height: 42px; line-height: 42px; margin: 0; }

.history-card { margin-top: 20px; display: none; }
.history-header-main { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.history-header-main h3 { font-size: 1.2rem; margin:0; text-shadow:none; color: #333; }
.btn-clear { color: #dc3545; cursor: pointer; font-size: 0.9rem; text-decoration: underline; }
.history-item { border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 10px; overflow: hidden; background: #fff; }
.history-title-bar { padding: 12px 16px; background: #f8f9fa; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.history-item.open .history-title-bar { background: #e9ecef; }
.history-content { display: none; padding: 15px; border-top: 1px solid #e9ecef; }
.history-item.open .history-content { display: block; }

/* 底部版权 */
.footer-copyright { text-align: center; padding: 20px; color: rgba(255,255,255,0.8); font-size: 0.85rem; margin-top: 30px; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.footer-copyright a { color: white; text-decoration: underline; font-weight: bold; }
.footer-copyright a:hover { text-decoration: none; opacity: 0.9; }
